. // }}} /** * ActivityPub implementation for GNU social * * @package GNUsocial * @category OAuth2 * * @author Diogo Peralta Cordeiro <@diogo.site> * @copyright 2018-2019, 2021 Free Software Foundation, Inc http://www.fsf.org * @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later */ namespace Plugin\OAuth2\Entity; use App\Core\Entity; use DateTimeInterface; /** * OAuth application registration record * * @copyright 2018-2019, 2021 Free Software Foundation, Inc http://www.fsf.org * @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later */ class OAuth2ClientMeta extends Entity { // {{{ Autocode // @codeCoverageIgnoreStart private int $id; private string $identifier; private string $client_name; private ?string $website = null; private DateTimeInterface $created; private DateTimeInterface $modified; public function getId(): int { return $this->id; } public function setId(int $id): self { $this->id = $id; return $this; } public function getIdentifier(): string { return $this->identifier; } public function setIdentifier(string $identifier): self { $this->identifier = $identifier; return $this; } public function getClientName(): string { return $this->client_name; } public function setClientName(string $client_name): self { $this->client_name = $client_name; return $this; } public function getWebsite(): ?string { return $this->website; } public function setWebsite(?string $website): self { $this->website = $website; return $this; } public function setCreated(DateTimeInterface $created): self { $this->created = $created; return $this; } public function getCreated(): DateTimeInterface { return $this->created; } public function setModified(DateTimeInterface $modified): self { $this->modified = $modified; return $this; } public function getModified(): DateTimeInterface { return $this->modified; } // @codeCoverageIgnoreEnd // }}} Autocode /** * Return table definition for Schema setup and Entity usage. * * @return array array of column definitions */ public static function schemaDef(): array { return [ 'name' => 'oauth2_client_meta', 'fields' => [ 'id' => ['type' => 'serial', 'not null' => true, 'description' => 'unique identifier'], 'identifier' => ['type' => 'varchar', 'length' => 32, 'description' => 'foreign key to oauth2_client->identifier'], 'client_name' => ['type' => 'varchar', 'length' => 191, 'not null' => true, 'description' => 'name of the application'], 'website' => ['type' => 'text', 'not null' => false, 'description' => 'application homepage - used for source link'], 'created' => ['type' => 'datetime', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was created'], 'modified' => ['type' => 'timestamp', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was modified'], ], 'primary key' => ['id'], ]; } }