id = $id; return $this; } /** * @return int */ public function getId(): int { return $this->id; } /** * @param string $itemId * * @return FederatedShare */ public function setItemId(string $itemId): self { $this->itemId = $itemId; return $this; } /** * @return string */ public function getItemId(): string { return $this->itemId; } /** * @param string $circleId * * @return FederatedShare */ public function setCircleId(string $circleId): self { $this->circleId = $circleId; return $this; } /** * @return string */ public function getCircleId(): string { return $this->circleId; } /** * @param string $instance * * @return FederatedShare */ public function setInstance(string $instance): self { $this->instance = $instance; return $this; } /** * @param string $lockStatus * * @return FederatedShare */ public function setLockStatus(string $lockStatus): self { $this->lockStatus = $lockStatus; return $this; } /** * @return string */ public function getLockStatus(): string { return $this->lockStatus; } /** * @return string */ public function getInstance(): string { return $this->instance; } /** * @return bool */ public function isLocal(): bool { return $this->getManager()->isLocalInstance($this->getInstance()); } /** * @param array $data * * @return IDeserializable */ public function import(array $data): IDeserializable { $this->setId($this->getInt('id', $data)); $this->setItemId($this->get('itemId', $data)); $this->setCircleId($this->get('circleId', $data)); $this->setInstance($this->get('instance', $data)); return $this; } /** * @param array $data * * @return IQueryRow */ public function importFromDatabase(array $data): IQueryRow { $this->setId($this->getInt('id', $data)); $this->setItemId($this->get('item_id', $data)); $this->setCircleId($this->get('circle_id', $data)); $this->setInstance($this->get('instance', $data)); if ($this->getInstance() === '') { $this->setInstance($this->getManager()->getLocalInstance()); } return $this; } /** * @return array */ public function jsonSerialize(): array { return [ 'id' => $this->getId(), 'itemId' => $this->getItemId(), 'circleId' => $this->getCircleId(), 'instance' => $this->getInstance() ]; } }