Advertisement
Puzo

Doctrine 2: Matches entity

Jan 9th, 2012
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.93 KB | None | 0 0
  1. <?php
  2. namespace models;
  3.  
  4. /**
  5.  * @Entity
  6.  * @Table(name="matches")
  7.  */
  8. class Matches {
  9.     /**
  10.      * @Id
  11.      * @Column(type="integer", nullable=false)
  12.      * @GeneratedValue(strategy="AUTO")
  13.      */
  14.     protected $id;
  15.      
  16.     /**
  17.      * @ManyToOne(targetEntity="Season", inversedBy="matches")
  18.      * @Column(type="integer", nullable=false)
  19.      */
  20.     protected $season_id;
  21.      
  22.     /**
  23.      * @Column(type="integer", nullable=false)
  24.      */
  25.     protected $league_id;
  26.      
  27.     /**
  28.      * @Column(type="datetime", nullable=false)
  29.      */
  30.     protected $play_date;
  31.    
  32.     /**
  33.      * @Column(type="integer", nullable=false)
  34.      */
  35.     protected $play_time;
  36.    
  37.     /**
  38.      * @Column(type="integer", nullable=false)
  39.      */
  40.     protected $week;
  41.    
  42.     /**
  43.      * @Column(type="integer", nullable=false)
  44.      */
  45.     protected $status;
  46.    
  47.     /**
  48.      * @OneToMany(targetEntity="ClubsMatches", mappedBy="match_id")
  49.      */
  50.     protected $clubsmatches;
  51.    
  52.    
  53.    
  54.     // GETTERS & SETTERS
  55.     public function setSeason_id(Season $season) {
  56.         if( $season === null || $season instanceof Season ) {
  57.             $this->season_id = $season;
  58.         } else {
  59.             throw new InvalidArgumentException($season . ' must be instance of Entity\Season or null');
  60.         }
  61.     }
  62.      
  63.     public function getSeason_id() {
  64.         return $this->season_id;
  65.     }
  66.    
  67.     public function setLeague_id($id) {
  68.         $this->league_id = $id;
  69.     }
  70.      
  71.     public function getLeague_id() {
  72.         return $this->league_id;
  73.     }
  74.    
  75.     public function setPlay_date($date) {
  76.         $this->play_date = $date;
  77.     }
  78.      
  79.     public function getPlay_date() {
  80.         return $this->play_date;
  81.     }
  82.    
  83.     public function setPlay_time($time) {
  84.         $this->play_time = $time;
  85.     }
  86.      
  87.     public function getPlay_time() {
  88.         return $this->play_time;
  89.     }
  90.    
  91.     public function setWeek($week) {
  92.         $this->week = $week;
  93.     }
  94.      
  95.     public function getWeek() {
  96.         return $this->week;
  97.     }
  98.    
  99.     public function setStatus($status) {
  100.         $this->status = $status;
  101.     }
  102.      
  103.     public function getStats() {
  104.         return $this->status;
  105.     }
  106. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement