lib/composer/ProductBundle/src/VisualMedia/ProductBundle/Entity/BaseProductCategory.php line 29

Open in your IDE?
  1. <?php
  2. /**
  3. * Base Product Category
  4. *
  5. * @author Vincent van Waasbergen <v.vanwaasbergen@visualmedia.nl>
  6. */
  7. namespace VisualMedia\ProductBundle\Entity;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use VisualMedia\LisaBundle\Component\Interfaces\EntityInterface;
  10. use VisualMedia\LisaBundle\Traits\BlameableTrait;
  11. use VisualMedia\LisaBundle\Traits\AutoIdTrait;
  12. use VisualMedia\FileBundle\Traits\ImageMetaTrait;
  13. use VisualMedia\LisaBundle\Traits\TimestampableTrait;
  14. use VisualMedia\ProductBundle\Model\BaseProductCategoryModel;
  15. use VisualMedia\OrderingBundle\Traits\OrderingTrait;
  16. /**
  17. * Base Product Category
  18. *
  19. * @ORM\Entity(repositoryClass="VisualMedia\ProductBundle\Manager\BaseProductCategoryManager")
  20. * @ORM\Table(name="product_category")
  21. *
  22. * @ORM\InheritanceType("SINGLE_TABLE")
  23. * @ORM\DiscriminatorColumn(name="discriminator", type="string")
  24. */
  25. class BaseProductCategory extends BaseProductCategoryModel implements EntityInterface
  26. {
  27. use BlameableTrait;
  28. use AutoIdTrait;
  29. use ImageMetaTrait;
  30. use OrderingTrait;
  31. use TimestampableTrait;
  32. /**
  33. * @ORM\ManyToMany(targetEntity="VisualMedia\TranslationBundle\Entity\BaseChannel")
  34. * @ORM\JoinTable(name="product_category_channel",
  35. * joinColumns={@ORM\JoinColumn(name="product_category_id", referencedColumnName="id", onDelete="CASCADE")},
  36. * inverseJoinColumns={@ORM\JoinColumn(name="channel_id", referencedColumnName="id", onDelete="CASCADE")}
  37. * )
  38. */
  39. public $channels;
  40. /**
  41. * Translatable
  42. */
  43. public $title;
  44. public $browserTitle;
  45. public $slug;
  46. public $metaDescription;
  47. public $metaKeywords;
  48. public $htmlContent;
  49. /**
  50. * @ORM\Column(name="published", type="boolean", nullable=false)
  51. */
  52. public $published = true;
  53. /**
  54. * @ORM\Column(name="indexable", type="boolean", nullable=false)
  55. */
  56. public $indexable = true;
  57. /**
  58. * @ORM\OneToOne(targetEntity="VisualMedia\FileBundle\Entity\BaseUpload")
  59. * @ORM\JoinColumn(name="upload_id", referencedColumnName="id", onDelete="SET NULL", nullable=true)
  60. */
  61. public $upload;
  62. /**
  63. * @ORM\ManyToOne(targetEntity="VisualMedia\ProductBundle\Entity\BaseProductCategory", inversedBy="children")
  64. * @ORM\JoinColumn(name="parent_id", referencedColumnName="id", onDelete="SET NULL")
  65. */
  66. public $parent;
  67. /**
  68. * @ORM\OneToMany(targetEntity="VisualMedia\ProductBundle\Entity\BaseProductCategory", mappedBy="parent")
  69. * @ORM\OrderBy({"ordering"="ASC"})
  70. */
  71. public $children;
  72. /**
  73. * @ORM\OneToMany(targetEntity="VisualMedia\ProductBundle\Entity\BaseProductCategoryLink", mappedBy="category")
  74. */
  75. public $products;
  76. /**
  77. * @ORM\OneToMany(targetEntity="VisualMedia\ProductBundle\Entity\BaseProductCategoryContent", mappedBy="category", cascade={"persist", "remove"}, orphanRemoval=true)
  78. */
  79. public $contents;
  80. }