2021-12-24 09:38:06 +09:00
< ? php
2021-12-26 18:48:16 +09:00
declare ( strict_types = 1 );
2021-12-24 09:38:06 +09:00
namespace Plugin\AttachmentCollections\Entity ;
use App\Core\Entity ;
2021-12-26 18:48:16 +09:00
2021-12-28 13:39:09 +09:00
class AttachmentCollectionEntry extends Entity
2021-12-24 09:38:06 +09:00
{
// These tags are meant to be literally included and will be populated with the appropriate fields, setters and getters by `bin/generate_entity_fields`
// {{{ Autocode
// @codeCoverageIgnoreStart
private int $id ;
2021-12-28 13:39:09 +09:00
private int $note_id ;
2021-12-24 09:38:06 +09:00
private int $attachment_id ;
2022-02-06 01:15:34 +09:00
private int $attachment_collection_id ;
2021-12-24 09:38:06 +09:00
public function setId ( int $id ) : self
{
$this -> id = $id ;
return $this ;
}
public function getId () : int
{
return $this -> id ;
}
2021-12-28 13:39:09 +09:00
public function setNoteId ( int $note_id ) : self
{
$this -> note_id = $note_id ;
return $this ;
}
public function getNoteId () : int
{
return $this -> note_id ;
}
2021-12-24 09:38:06 +09:00
public function setAttachmentId ( int $attachment_id ) : self
{
$this -> attachment_id = $attachment_id ;
return $this ;
}
public function getAttachmentId () : int
{
return $this -> attachment_id ;
}
2022-02-06 01:15:34 +09:00
public function setAttachmentCollectionId ( int $attachment_collection_id ) : self
2021-12-24 09:38:06 +09:00
{
2022-02-06 01:15:34 +09:00
$this -> attachment_collection_id = $attachment_collection_id ;
2021-12-24 09:38:06 +09:00
return $this ;
}
2022-02-06 01:15:34 +09:00
public function getAttachmentCollectionId () : int
2021-12-24 09:38:06 +09:00
{
2022-02-06 01:15:34 +09:00
return $this -> attachment_collection_id ;
2021-12-24 09:38:06 +09:00
}
// @codeCoverageIgnoreEnd
// }}} Autocode
2022-03-08 09:21:12 +09:00
public static function schemaDef () : array
2021-12-24 09:38:06 +09:00
{
return [
2021-12-28 13:39:09 +09:00
'name' => 'attachment_collection_entry' ,
2021-12-24 09:38:06 +09:00
'fields' => [
2022-02-06 01:15:34 +09:00
'id' => [ 'type' => 'serial' , 'not null' => true , 'description' => 'unique identifier' ],
'note_id' => [ 'type' => 'int' , 'foreign key' => true , 'target' => 'Note.id' , 'multiplicity' => 'one to one' , 'not null' => true , 'description' => 'foreign key to note table' ],
'attachment_id' => [ 'type' => 'int' , 'foreign key' => true , 'target' => 'Attachment.id' , 'multiplicity' => 'one to one' , 'not null' => true , 'description' => 'foreign key to attachment table' ],
'attachment_collection_id' => [ 'type' => 'int' , 'foreign key' => true , 'target' => 'AttachmentCollection.id' , 'multiplicity' => 'one to one' , 'not null' => true , 'description' => 'foreign key to collection table' ],
2021-12-24 09:38:06 +09:00
],
'primary key' => [ 'id' ],
];
}
}