lib/composer/ContentBlockBundle/src/VisualMedia/ContentBlockBundle/Entity/BaseContentBlock.php line 28

Open in your IDE?
  1. <?php
  2. /**
  3. * Base Content Block
  4. *
  5. * @author Bertin van den Ham <b.vandenham@visualmedia.nl>
  6. */
  7. namespace VisualMedia\ContentBlockBundle\Entity;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use VisualMedia\ContentBlockBundle\Model\BaseContentBlockModel;
  10. use VisualMedia\FileBundle\Traits\ImageMetaTrait;
  11. use VisualMedia\LisaBundle\Component\Interfaces\EntityInterface;
  12. use VisualMedia\LisaBundle\Traits\BlameableTrait;
  13. use VisualMedia\LisaBundle\Traits\AutoIdTrait;
  14. use VisualMedia\LisaBundle\Traits\TimestampableTrait;
  15. /**
  16. * Base Content Block
  17. *
  18. * @ORM\Entity(repositoryClass="VisualMedia\ContentBlockBundle\Manager\BaseContentBlockManager")
  19. * @ORM\Table(name="content_block")
  20. *
  21. * @ORM\InheritanceType("SINGLE_TABLE")
  22. * @ORM\DiscriminatorColumn(name="discriminator", type="string")
  23. */
  24. class BaseContentBlock extends BaseContentBlockModel implements EntityInterface
  25. {
  26. use BlameableTrait;
  27. use AutoIdTrait;
  28. use ImageMetaTrait;
  29. use TimestampableTrait;
  30. /**
  31. * @ORM\ManyToMany(targetEntity="VisualMedia\TranslationBundle\Entity\BaseChannel")
  32. * @ORM\JoinTable(name="content_block_channel",
  33. * joinColumns={@ORM\JoinColumn(name="content_block_id", referencedColumnName="id", onDelete="CASCADE")},
  34. * inverseJoinColumns={@ORM\JoinColumn(name="channel_id", referencedColumnName="id", onDelete="CASCADE")}
  35. * )
  36. */
  37. public $channels;
  38. /**
  39. * @ORM\OneToMany(targetEntity="VisualMedia\ContentBlockBundle\Entity\BaseContentBlockContent", mappedBy="contentBlock", cascade={"persist", "remove"}, orphanRemoval=true)
  40. */
  41. public $contents;
  42. /**
  43. * Translatable
  44. */
  45. public $title;
  46. public $htmlContent;
  47. /**
  48. * @ORM\Column(name="reference", type="string", length=255, nullable=false)
  49. */
  50. public $reference;
  51. /**
  52. * @ORM\Column(name="link", type="string", length=255, nullable=true)
  53. */
  54. public $link;
  55. /**
  56. * @ORM\OneToOne(targetEntity="VisualMedia\FileBundle\Entity\BaseUpload")
  57. * @ORM\JoinColumn(name="upload_id", referencedColumnName="id", onDelete="SET NULL", nullable=true)
  58. */
  59. public $upload;
  60. }