diff --git a/src/Socialbox/Abstracts/Entity.php b/src/Socialbox/Abstracts/Entity.php deleted file mode 100644 index 03dbab7..0000000 --- a/src/Socialbox/Abstracts/Entity.php +++ /dev/null @@ -1,115 +0,0 @@ -uuid = $data['uuid']; - $this->type = $data['type']; - $this->username = $data['username']; - $this->domain = $data['domain']; - $this->display_name = $data['display_name']; - } - - /** - * Returns the Unique Universal Identifier (UUID v4) of the entity. - * - * @return string - */ - public function getUuid(): string - { - return $this->uuid; - } - - /** - * Returns the EntityType of the entity. - * - * @return EntityType - */ - public function getType(): EntityType - { - return $this->type; - } - - /** - * Returns the username of the entity. - * - * @return string - */ - public function getUsername(): string - { - return $this->username; - } - - /** - * Returns the domain that the entity belongs to, `LOCAL` for local entities. - * - * @return string - */ - public function getDomain(): string - { - return $this->domain; - } - - /** - * Returns the display name of the entity. - * - * @return string - */ - public function getDisplayName(): string - { - return $this->display_name; - } - - /** - * Returns the address of the entity in the format `username@domain`. - * - * @return string - */ - public function getAddress(): string - { - return sprintf('%s@%s', $this->username, $this->domain); - } - - /** - * Serializes the entity to an array. - * - * @return array - */ - public function toArray(): array - { - return [ - 'uuid' => $this->uuid, - 'type' => $this->type, - 'username' => $this->username, - 'domain' => $this->domain, - 'display_name' => $this->display_name, - ]; - } - - /** - * Constructs the entity object from an array of data. - * - * @param array $data The data to construct the entity from. - */ - public static function fromArray(array $data): Entity - { - return new static($data); - } -} \ No newline at end of file