Advertisement
Guest User

Untitled

a guest
Feb 13th, 2013
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.31 KB | None | 0 0
  1. <?php
  2.  
  3. namespace My\MoviesBundle\Entity;
  4.  
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Gedmo\Mapping\Annotation as Gedmo;
  7. /**
  8.  * Orders
  9.  *
  10.  * @ORM\Table()
  11.  * @ORM\Entity(repositoryClass="My\MoviesBundle\Entity\OrdersRepository")
  12.  */
  13. class Orders
  14. {
  15.     /**
  16.      * @var integer
  17.      * @ORM\Column(name="id", type="integer")
  18.      * @ORM\Id
  19.      * @ORM\GeneratedValue(strategy="AUTO")
  20.      */
  21.     private $id;
  22.    
  23.     /**
  24.      * @var Entity User
  25.      * @ORM\OneToOne(targetEntity="\Application\Sonata\UserBundle\Entity\User", inversedBy="order")
  26.      */
  27.     private $user;
  28.    
  29.     /**
  30.      * @ORM\OneToMany(targetEntity="MovieHasOrder", mappedBy="order", cascade={"all"})
  31.      */
  32.     private $orderMovie;
  33.    
  34.     /**
  35.      * @ORM\Column(name="status", type="string", length=255)
  36.      * @var string
  37.      */
  38.     private $status;
  39.    
  40.     /**
  41.      * @var Entity Address
  42.      * @ORM\OneToOne(targetEntity="\My\DefaultBundle\Entity\Address")
  43.      */
  44.     private $address;
  45.    
  46.     /**
  47.      * @var Entity Carrier
  48.      * @ORM\OneToOne(targetEntity="\My\DefaultBundle\Entity\Carrier")
  49.      */
  50.     private $carrier;
  51.    
  52.      /**
  53.      * @ORM\Column(name="note", type="text", nullable=true)
  54.      * @var string
  55.      */
  56.     private $note;
  57.    
  58.     /**
  59.      * @var datetime $date
  60.      * @ORM\Column(type="date")
  61.      * @Gedmo\Timestampable(on="update")
  62.      */
  63.     private $date;
  64.    
  65.     /**
  66.      * @var string $session
  67.      * @ORM\Column(name="session", type="string", length=26, unique=true)
  68.      */
  69.     private $session;
  70.    
  71.     /**
  72.      * Constructor
  73.      */
  74.     public function __construct()
  75.     {
  76.         $this->orderMovie = new \Doctrine\Common\Collections\ArrayCollection();
  77.     }
  78.    
  79.     /**
  80.      * Get id
  81.      * @return integer
  82.      */
  83.     public function getId()
  84.     {
  85.         return $this->id;
  86.     }
  87.  
  88.     /**
  89.      * Set status
  90.      * @param string $status
  91.      * @return Orders
  92.      */
  93.     public function setStatus($status)
  94.     {
  95.         $this->status = $status;
  96.         return $this;
  97.     }
  98.  
  99.     /**
  100.      * Get status
  101.      * @return string
  102.      */
  103.     public function getStatus()
  104.     {
  105.         return $this->status;
  106.     }
  107.  
  108.     /**
  109.      * Set user
  110.      * @param \Application\Sonata\UserBundle\Entity\User $user
  111.      * @return Orders
  112.      */
  113.     public function setUser(\Application\Sonata\UserBundle\Entity\User $user = null)
  114.     {
  115.         $this->user = $user;
  116.         return $this;
  117.     }
  118.  
  119.    
  120.     /**
  121.      * Get user
  122.      * @return \Application\Sonata\UserBundle\Entity\User
  123.      */
  124.     public function getUser()
  125.     {
  126.         return $this->user;
  127.     }
  128.    
  129.    
  130.    
  131.     /**
  132.      * Add orderMovie
  133.      * @param \My\MoviesBundle\Entity\MovieHasOrder $orderMovie
  134.      * @return Orders
  135.      */
  136.     public function addOrderMovie(\My\MoviesBundle\Entity\MovieHasOrder $orderMovie)
  137.     {
  138.         $this->orderMovie[] = $orderMovie;
  139.         return $this;
  140.     }
  141.  
  142.     /**
  143.      * Remove orderMovie
  144.      * @param \My\MoviesBundle\Entity\MovieHasOrder $orderMovie
  145.      */
  146.     public function removeOrderMovie(\My\MoviesBundle\Entity\MovieHasOrder $orderMovie)
  147.     {
  148.         $this->orderMovie->removeElement($orderMovie);
  149.     }
  150.  
  151.     /**
  152.      * Get orderMovie
  153.      * @return \Doctrine\Common\Collections\Collection
  154.      */
  155.     public function getOrderMovie()
  156.     {
  157.         return $this->orderMovie;
  158.     }
  159.  
  160.     /**
  161.      * Set address
  162.      * @param \My\DefaultBundle\Entity\Address $address
  163.      * @return Orders
  164.      */
  165.     public function setAddress(\My\DefaultBundle\Entity\Address $address = null)
  166.     {
  167.         $this->address = $address;
  168.         return $this;
  169.     }
  170.  
  171.     /**
  172.      * Get address
  173.      * @return \My\DefaultBundle\Entity\Address
  174.      */
  175.     public function getAddress()
  176.     {
  177.         return $this->address;
  178.     }
  179.  
  180.     /**
  181.      * Set carrier
  182.      * @param \My\DefaultBundle\Entity\Carrier $carrier
  183.      * @return Orders
  184.      */
  185.     public function setCarrier(\My\DefaultBundle\Entity\Carrier $carrier = null)
  186.     {
  187.         $this->carrier = $carrier;
  188.         return $this;
  189.     }
  190.  
  191.     /**
  192.      * Get carrier
  193.      * @return \My\DefaultBundle\Entity\Carrier
  194.      */
  195.     public function getCarrier()
  196.     {
  197.         return $this->carrier;
  198.     }
  199.  
  200.     /**
  201.      * Set note
  202.      * @param string $note
  203.      * @return Orders
  204.      */
  205.     public function setNote($note)
  206.     {
  207.         $this->note = $note;
  208.         return $this;
  209.     }
  210.  
  211.     /**
  212.      * Get note
  213.      * @return string
  214.      */
  215.     public function getNote()
  216.     {
  217.         return $this->note;
  218.     }
  219.  
  220.     /**
  221.      * Set date
  222.      * @param \DateTime $date
  223.      * @return Orders
  224.      */
  225.     public function setDate($date)
  226.     {
  227.         $this->date = $date;
  228.         return $this;
  229.     }
  230.  
  231.     /**
  232.      * Get date
  233.      * @return \DateTime
  234.      */
  235.     public function getDate()
  236.     {
  237.         return $this->date;
  238.     }
  239.  
  240.     /**
  241.      * Set session
  242.      * @param string $session
  243.      * @return Orders
  244.      */
  245.     public function setSession($session)
  246.     {
  247.         $this->session = $session;
  248.         return $this;
  249.     }
  250.  
  251.     /**
  252.      * Get session
  253.      * @return string
  254.      */
  255.     public function getSession()
  256.     {
  257.         return $this->session;
  258.     }
  259.    
  260.     public function __toString() {
  261.         return 'ORDERS TO STRING';
  262.     }
  263.    
  264. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement