<?php
/**
* Base Product Category
*
* @author Vincent van Waasbergen <v.vanwaasbergen@visualmedia.nl>
*/
namespace VisualMedia\ProductBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use VisualMedia\LisaBundle\Component\Interfaces\EntityInterface;
use VisualMedia\LisaBundle\Traits\BlameableTrait;
use VisualMedia\LisaBundle\Traits\AutoIdTrait;
use VisualMedia\FileBundle\Traits\ImageMetaTrait;
use VisualMedia\LisaBundle\Traits\TimestampableTrait;
use VisualMedia\ProductBundle\Model\BaseProductCategoryModel;
use VisualMedia\OrderingBundle\Traits\OrderingTrait;
/**
* Base Product Category
*
* @ORM\Entity(repositoryClass="VisualMedia\ProductBundle\Manager\BaseProductCategoryManager")
* @ORM\Table(name="product_category")
*
* @ORM\InheritanceType("SINGLE_TABLE")
* @ORM\DiscriminatorColumn(name="discriminator", type="string")
*/
class BaseProductCategory extends BaseProductCategoryModel implements EntityInterface
{
use BlameableTrait;
use AutoIdTrait;
use ImageMetaTrait;
use OrderingTrait;
use TimestampableTrait;
/**
* @ORM\ManyToMany(targetEntity="VisualMedia\TranslationBundle\Entity\BaseChannel")
* @ORM\JoinTable(name="product_category_channel",
* joinColumns={@ORM\JoinColumn(name="product_category_id", referencedColumnName="id", onDelete="CASCADE")},
* inverseJoinColumns={@ORM\JoinColumn(name="channel_id", referencedColumnName="id", onDelete="CASCADE")}
* )
*/
public $channels;
/**
* Translatable
*/
public $title;
public $browserTitle;
public $slug;
public $metaDescription;
public $metaKeywords;
public $htmlContent;
/**
* @ORM\Column(name="published", type="boolean", nullable=false)
*/
public $published = true;
/**
* @ORM\Column(name="indexable", type="boolean", nullable=false)
*/
public $indexable = true;
/**
* @ORM\OneToOne(targetEntity="VisualMedia\FileBundle\Entity\BaseUpload")
* @ORM\JoinColumn(name="upload_id", referencedColumnName="id", onDelete="SET NULL", nullable=true)
*/
public $upload;
/**
* @ORM\ManyToOne(targetEntity="VisualMedia\ProductBundle\Entity\BaseProductCategory", inversedBy="children")
* @ORM\JoinColumn(name="parent_id", referencedColumnName="id", onDelete="SET NULL")
*/
public $parent;
/**
* @ORM\OneToMany(targetEntity="VisualMedia\ProductBundle\Entity\BaseProductCategory", mappedBy="parent")
* @ORM\OrderBy({"ordering"="ASC"})
*/
public $children;
/**
* @ORM\OneToMany(targetEntity="VisualMedia\ProductBundle\Entity\BaseProductCategoryLink", mappedBy="category")
*/
public $products;
/**
* @ORM\OneToMany(targetEntity="VisualMedia\ProductBundle\Entity\BaseProductCategoryContent", mappedBy="category", cascade={"persist", "remove"}, orphanRemoval=true)
*/
public $contents;
}