. // }}} namespace Plugin\WebHooks\Entity; use App\Core\Entity; use DateTimeInterface; class WebHook extends Entity { // {{{ Autocode // @codeCoverageIgnoreStart private int $actor_id; private string $event; private string $target; private DateTimeInterface $created; private DateTimeInterface $modified; public function setActorId(int $actor_id): self { $this->actor_id = $actor_id; return $this; } public function getActorId(): int { return $this->actor_id; } public function setEvent(string $event): self { $this->event = mb_substr($event, 0, 32); return $this; } public function getEvent(): string { return $this->event; } public function setTarget(string $target): self { $this->target = $target; return $this; } public function getTarget(): string { return $this->target; } 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 public static function schemaDef(): array { return [ 'name' => 'webhook', 'fields' => [ 'actor_id' => ['type' => 'int', 'not null' => true, 'actor who made this hook'], 'event' => ['type' => 'varchar', 'length' => 32, 'not null' => true, 'description' => 'name of the event this is a hook for'], 'target' => ['type' => 'text', 'not null' => true, 'description' => 'the target URL to POST to'], 'created' => ['type' => 'datetime', 'not null' => true, 'description' => 'date this record was created'], 'modified' => ['type' => 'timestamp', 'not null' => true, 'description' => 'date this record was modified'], ], 'primary key' => ['actor_id', 'event'], 'indexes' => [ 'webhook_actor_id_idx' => ['actor_id'], ], ]; } }