| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319 |
- <?php
- namespace AppBundle\Entity\Core;
- use Doctrine\ORM\Mapping as ORM;
- use Dunglas\ApiBundle\Annotation\Iri;
- use Symfony\Component\Serializer\Annotation\Groups;
- use Symfony\Component\Validator\Constraints as Assert;
- use AppBundle\Entity\Traits\TimestampableEntity;
- use AppBundle\Entity\Traits\CreatorUpdaterEntity;
- use AppBundle\Entity\Organization\Organization;
- use AppBundle\Entity\AccessAndFunction\Access;
- use Gedmo\Mapping\Annotation as Gedmo;
- use AppBundle\Annotation\DefaultField;
- /**
- * (Non utilisé, à confirmer)
- *
- * @Iri("http://schema.org/Document")
- */
- #[ORM\Entity(repositoryClass: 'AppBundle\Entity\Core\Repository\DocumentRepository')]
- class Document
- {
- use TimestampableEntity;
- use CreatorUpdaterEntity;
- /**
- * @var int
- */
- #[ORM\Column(type: 'integer')]
- #[ORM\Id]
- #[ORM\GeneratedValue(strategy: 'AUTO')]
- #[Groups(['document'])]
- private $id;
- /**
- * @var string
- */
- #[ORM\Column(type: 'string', length: 255, nullable: true)]
- #[Assert\Type(type: 'string')]
- #[Groups(['document'])]
- private $name;
- /**
- * @Gedmo\Slug(fields={"name", "createDate"}, style="camel", separator="_", suffix="html.twig")
- */
- #[ORM\Column(length: 255, unique: true)]
- private $slug;
- /**
- * @var Access
- *
- * @DefaultField
- */
- #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\AccessAndFunction\Access', inversedBy: 'documentAuthors')]
- #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
- #[ORM\JoinColumn(nullable: true)]
- #[Groups(['document'])]
- private $author;
- /**
- * @var Organization
- * @DefaultField
- */
- #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\Organization\Organization', inversedBy: 'documents')]
- #[ORM\JoinColumn(nullable: true)]
- #[Groups(['document'])]
- private $organization;
- /**
- * @var string
- */
- #[ORM\Column(type: 'string', length: 255, nullable: true)]
- #[Assert\Type(type: 'string')]
- #[Groups(['document'])]
- private $about;
- /**
- * @var string
- */
- #[ORM\Column(type: 'text', nullable: true)]
- #[Assert\Type(type: 'string')]
- #[Groups(['document'])]
- private $headline;
- /**
- * @var string
- */
- #[ORM\Column(type: 'text', nullable: true)]
- #[Assert\Type(type: 'string')]
- #[Groups(['document'])]
- private $text;
- /**
- * @var bool
- */
- #[ORM\Column(type: 'boolean', options: ['default' => 0])]
- #[Assert\Type(type: 'boolean')]
- #[Assert\NotNull]
- #[Groups(['super_admin'])]
- private $isSystem = false;
- /**
- * @var bool
- */
- #[ORM\Column(type: 'boolean', options: ['default' => 0])]
- #[Assert\Type(type: 'boolean')]
- #[Assert\NotNull]
- #[Groups(['document'])]
- private $template = false;
- /**
- * The constructor
- *
- * @param string $about
- * @param string $headline
- * @param string $text
- */
- public function __construct($about = null, $headline = null, $text = null) {
- $this->about = $about;
- $this->headline = $headline;
- $this->text = $text;
- }
- /**
- * Sets id.
- *
- * @param int $id
- *
- * @return $this
- */
- public function setId($id) {
- $this->id = $id;
- return $this;
- }
- /**
- * Gets id.
- *
- * @return int
- */
- public function getId() {
- return $this->id;
- }
- /**
- * Sets name.
- *
- * @param string $name
- *
- * @return $this
- */
- public function setName($name) {
- $this->name = $name;
- return $this;
- }
- /**
- * Gets name.
- *
- * @return string
- */
- public function getName() {
- return $this->name;
- }
- /**
- * Sets author.
- *
- * @param Access $author
- *
- * @return $this
- */
- public function setAuthor(Access $author) {
- $this->author = $author;
- return $this;
- }
- /**
- * Gets author.
- *
- * @return Access
- */
- public function getAuthor() {
- return $this->author;
- }
- /**
- * Sets organization.
- *
- * @param Organization $organization
- *
- * @return $this
- */
- public function setOrganization(Organization $organization = null) {
- $this->organization = $organization;
- return $this;
- }
- /**
- * Gets organization.
- *
- * @return Organization
- */
- public function getOrganization() {
- return $this->organization;
- }
- /**
- * Sets about.
- *
- * @param string $about
- *
- * @return $this
- */
- public function setAbout($about) {
- $this->about = $about;
- return $this;
- }
- /**
- * Gets about.
- *
- * @return string
- */
- public function getAbout() {
- return $this->about;
- }
- /**
- * Sets headline.
- *
- * @param string $headline
- *
- * @return $this
- */
- public function setHeadline($headline) {
- $this->headline = $headline;
- return $this;
- }
- /**
- * Gets headline.
- *
- * @return string
- */
- public function getHeadline() {
- return $this->headline;
- }
- /**
- * Set text
- *
- * @param string $text
- *
- * @return Template
- */
- public function setText($text)
- {
- $this->text = $text;
- return $this;
- }
- /**
- * Get text
- *
- * @return string
- */
- public function getText()
- {
- return $this->text;
- }
- /**
- * Sets isSystem.
- *
- * @param bool $isSystem
- *
- * @return $this
- */
- public function setIsSystem($isSystem) {
- $this->isSystem = $isSystem;
- return $this;
- }
- /**
- * Gets isSystem.
- *
- * @return bool
- */
- public function getIsSystem() {
- return $this->isSystem;
- }
- /**
- * Is isSystem.
- *
- * @return bool
- */
- public function isSystem() {
- return $this->isSystem;
- }
- /**
- * Sets is a template.
- *
- * @param bool $template
- *
- * @return $this
- */
- public function setTemplate($template) {
- $this->template = $template;
- return $this;
- }
- /**
- * Gets template.
- *
- * @return bool
- */
- public function getTemplate() {
- return $this->template;
- }
- /**
- * Is a template
- *
- * @return bool
- */
- public function isTemplate() {
- return $this->template;
- }
- /**
- *
- *
- * @return string
- */
- public function getSlug()
- {
- return $this->slug;
- }
- }
|