. */ namespace SP\Domain\Account\Out; defined('APP_ROOT') || die(); use JsonSerializable; use SP\Domain\Common\Out\DataModelBase; use SP\Domain\Common\Out\DataModelInterface; use SP\Http\Json; /** * Class AccountData */ class AccountData extends DataModelBase implements JsonSerializable, DataModelInterface { protected int $id; protected ?int $userId = null; protected ?int $userGroupId = null; protected ?int $userEditId = null; protected ?string $name = null; protected ?int $clientId = null; protected ?int $categoryId = null; protected ?string $login = null; protected ?string $url = null; protected ?string $pass = null; protected ?string $key = null; protected ?string $notes = null; protected ?int $dateAdd = 0; protected ?int $dateEdit = 0; protected ?int $countView = 0; protected ?int $countDecrypt = 0; protected ?int $isPrivate = 0; protected ?int $isPrivateGroup = 0; protected ?int $passDate = 0; protected ?int $passDateChange = 0; protected ?int $parentId = 0; protected ?bool $otherUserGroupEdit = false; protected ?bool $otherUserEdit = false; public function __construct(int $accountId = 0, ?array $properties = []) { parent::__construct($properties); $this->id = $accountId; } public function getDateAdd(): ?int { return $this->dateAdd; } public function getDateEdit(): ?int { return $this->dateEdit; } public function getUserEditId(): ?int { return $this->userEditId; } public function getPass(): ?string { return $this->pass; } public function setPass(string $pass) { $this->pass = $pass; } public function getKey(): ?string { return $this->key; } public function setKey(string $key) { $this->key = $key; } public function getId(): ?int { return $this->id; } public function getUserId(): ?int { return $this->userId; } public function getUserGroupId(): ?int { return $this->userGroupId; } public function getName(): ?string { return $this->name; } public function getCategoryId(): ?int { return $this->categoryId; } public function getClientId(): ?int { return $this->clientId; } public function getLogin(): ?string { return $this->login; } public function getUrl(): ?string { return $this->url; } public function getNotes(): ?string { return $this->notes; } /** * Specify data which should be serialized to JSON * * @link http://php.net/manual/en/jsonserializable.jsonserialize.php * @return mixed data which can be serialized by json_encode, * which is a value of any type other than a resource. * @since 5.4.0 */ public function jsonSerialize(): mixed { $data = get_object_vars($this); unset($data['accountPass'], $data['accountIV']); return Json::safeJson($data); } public function getCountView(): ?int { return $this->countView; } public function getCountDecrypt(): ?int { return $this->countDecrypt; } public function getIsPrivate(): ?int { return $this->isPrivate; } public function getPassDate(): ?int { return $this->passDate; } public function getPassDateChange(): ?int { return $this->passDateChange; } public function getParentId(): ?int { return $this->parentId; } public function getIsPrivateGroup(): ?int { return $this->isPrivateGroup; } public function getOtherUserGroupEdit(): ?bool { return $this->otherUserGroupEdit; } public function getOtherUserEdit(): ?bool { return $this->otherUserEdit; } }