addType('itemId', 'integer'); $this->addType('vaultId', 'integer'); $this->addType('permissions', 'integer'); $this->addType('created', 'integer'); $this->addType('targetVaultId', 'integer'); } /** * 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 */ function jsonSerialize() { return [ 'req_id' => $this->getId(), 'item_id' => $this->getItemId(), 'item_guid' => $this->getItemGuid(), 'target_user_id' => $this->getTargetUserId(), 'target_vault_id' => $this->getTargetVaultId(), 'target_vault_guid' => $this->getTargetVaultGuid(), 'from_user_id' => $this->getFromUserId(), 'shared_key' => $this->getSharedKey(), 'permissions' => $this->getPermissions(), 'created' => $this->getCreated(), ]; } function asACLJson(){ return [ 'item_id' => $this->getItemId(), 'item_guid' => $this->getItemGuid(), 'user_id' => $this->getTargetUserId(), 'created' => $this->getCreated(), 'permissions' => $this->getPermissions(), 'vault_id' => $this->getTargetVaultId(), 'vault_guid' => $this->getTargetVaultGuid(), 'shared_key' => $this->getSharedKey(), 'pending' => true, ]; } }