app/Customize/Entity/FavoriteKey.php line 17

Open in your IDE?
  1. <?php
  2. namespace Customize\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Eccube\Entity\AbstractEntity;
  6. /**
  7.  * FavoriteKey
  8.  *
  9.  * @ORM\Table(name="favorite_key")
  10.  * @ORM\InheritanceType("SINGLE_TABLE")
  11.  * @ORM\DiscriminatorColumn(name="discriminator_type", type="string", length=255)
  12.  * @ORM\HasLifecycleCallbacks()
  13.  * @ORM\Entity(repositoryClass="Customize\Repository\FavoriteKeyRepository")
  14.  */
  15. class FavoriteKey extends AbstractEntity
  16. {
  17.     /**
  18.      * @var int
  19.      * @ORM\Column(name="id", type="integer", options={"unsigned":true})
  20.      * @ORM\Id
  21.      * @ORM\GeneratedValue(strategy="IDENTITY")
  22.      */
  23.     private $id;
  24.     /**
  25.      * @var string
  26.      * @ORM\Column(name="cookie_key", type="string", length=255)
  27.      */
  28.     private $cookie_key;
  29.     /**
  30.      * @var \DateTime
  31.      * @ORM\Column(name="create_date", type="datetimetz")
  32.      */
  33.     private $create_date;
  34.     /**
  35.      * @var \DateTime
  36.      * @ORM\Column(name="update_date", type="datetimetz")
  37.      */
  38.     private $update_date;
  39.     /**
  40.      * @var \Doctrine\Common\Collections\Collection
  41.      * @ORM\OneToMany(targetEntity="Customize\Entity\FavoriteProduct", mappedBy="FavoriteKey")
  42.      */
  43.     private $FavoriteProducts;
  44.     public function __construct()
  45.     {
  46.         $this->FavoriteProducts = new ArrayCollection();
  47.     }
  48.     public function getId() { return $this->id; }
  49.     public function setCookieKey($cookieKey) { $this->cookie_key $cookieKey; return $this; }
  50.     public function getCookieKey() { return $this->cookie_key; }
  51.     public function setCreateDate($createDate) { $this->create_date $createDate; return $this; }
  52.     public function getCreateDate() { return $this->create_date; }
  53.     public function setUpdateDate($updateDate) { $this->update_date $updateDate; return $this; }
  54.     public function getUpdateDate() { return $this->update_date; }
  55.     public function addFavoriteProduct(FavoriteProduct $favoriteProduct) { $this->FavoriteProducts[] = $favoriteProduct; return $this; }
  56.     public function removeFavoriteProduct(FavoriteProduct $favoriteProduct) { return $this->FavoriteProducts->removeElement($favoriteProduct); }
  57.     public function getFavoriteProducts() { return $this->FavoriteProducts; }
  58. }