. * * The interactive user interfaces in modified source and object code versions * of this program must display Appropriate Legal Notices, as required under * Section 5 of the GNU Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ namespace Espo\Core\Record; /** * Immutable. */ class UpdateParams { private bool $skipDuplicateCheck = false; private ?int $versionNumber = null; private ?UpdateContext $context = null; public function __construct() {} public function withSkipDuplicateCheck(bool $skipDuplicateCheck = true): self { $obj = clone $this; $obj->skipDuplicateCheck = $skipDuplicateCheck; return $obj; } public function withVersionNumber(?int $versionNumber): self { $obj = clone $this; $obj->versionNumber = $versionNumber; return $obj; } public function skipDuplicateCheck(): bool { return $this->skipDuplicateCheck; } public function getVersionNumber(): ?int { return $this->versionNumber; } public static function create(): self { return new self(); } /** * @internal * @todo Remove in v10.0. */ public function withContext(?UpdateContext $context): self { $obj = clone $this; $obj->context = $context; return $obj; } /** * @internal * @todo Remove in v10.0. */ public function getContext(): ?UpdateContext { return $this->context; } }