Advertisement
Puzo

Doctrine 2: Clubs entity

Jan 9th, 2012
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.58 KB | None | 0 0
  1. <?php
  2. namespace Entities;
  3.  
  4. /**
  5.  * @Entity
  6.  * @Table(name="clubs")
  7.  */
  8. class Clubs {
  9.     /**
  10.      * @Id
  11.      * @Column(type="integer", nullable=false)
  12.      * @GeneratedValue(strategy="AUTO")
  13.      */
  14.     protected $id;
  15.      
  16.     /**
  17.      * @OneToOne(targetEntity="League", inversedBy="club")
  18.      * @JoinColumn(name="league_id", referencedColumnName="id")
  19.      * @Column(type="integer", nullable=false)
  20.      */
  21.     protected $league_id;
  22.    
  23.     /**
  24.      * @Column(type="string", length="255", nullable=false)
  25.      */
  26.     protected $title;
  27.    
  28.     /**
  29.      * @Column(type="string", length="255", nullable=false)
  30.      */
  31.     protected $logo;
  32.    
  33.     /**
  34.      * @Column(type="datetime", nullable=false)
  35.      */
  36.     protected $cdate;
  37.    
  38.     /**
  39.      * @Column(type="datetime", nullable=false)
  40.      */
  41.     protected $mdate;
  42.    
  43.     /**
  44.      * @OneToMany(targetEntity="ClubsMatches", mappedBy="club_id")
  45.      */
  46.     protected $clubsmatches;
  47.    
  48.    
  49.     // GETTERS & SETTERS
  50.     public function setLeague_id($league) {
  51.         $this->league_id = $league;
  52.     }
  53.      
  54.     public function getLeague_id() {
  55.         return $this->league_id;
  56.     }
  57.    
  58.     public function setTitle($title) {
  59.         $this->title = (string)$title;
  60.     }
  61.      
  62.     public function getTitle() {
  63.         return $this->title;
  64.     }
  65.    
  66.     public function setLogo($logo) {
  67.         $this->logo = (string)$logo;
  68.     }
  69.      
  70.     public function getLogo() {
  71.         return $this->logo;
  72.     }
  73.    
  74.     public function setCdate($date) {
  75.         $this->cdate = $date;
  76.     }
  77.      
  78.     public function getCdate() {
  79.         return $this->cdate;
  80.     }
  81.    
  82.     public function setMdate($date) {
  83.         $this->mdate = $date;
  84.     }
  85.      
  86.     public function getMdate() {
  87.         return $this->mdate;
  88.     }
  89. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement