Advertisement
Guest User

Untitled

a guest
Sep 29th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.19 KB | None | 0 0
  1. Author
  2.  
  3. <?php
  4.  
  5. namespace CodersLabBundle\Entity;
  6.  
  7. use Doctrine\ORM\Mapping as ORM;
  8.  
  9. /**
  10.  * Author
  11.  *
  12.  * @ORM\Table()
  13.  * @ORM\Entity(repositoryClass="CodersLabBundle\Entity\AuthorRepository")
  14.  */
  15. class Author {
  16.  
  17.     /**
  18.      *@ORM\OneToMany(targetEntity="Book", mappedBy="author")
  19.      */
  20.     private $books;
  21.    
  22.     public function __construct() {
  23.         $this->books = new ArrayCollection();
  24.     }
  25.    
  26.     /**
  27.      * @var integer
  28.      *
  29.      * @ORM\Column(name="id", type="integer")
  30.      * @ORM\Id
  31.      * @ORM\GeneratedValue(strategy="AUTO")
  32.      */
  33.     private $id;
  34.  
  35.     /**
  36.      * @var string
  37.      *
  38.      * @ORM\Column(name="name", type="string", length=255)
  39.      */
  40.     private $name;
  41.  
  42.     /**
  43.      * @var string
  44.      *
  45.      * @ORM\Column(name="surname", type="string", length=255)
  46.      */
  47.     private $surname;
  48.  
  49.     /**
  50.      * @var string
  51.      *
  52.      * @ORM\Column(name="description", type="string", length=255)
  53.      */
  54.     private $description;
  55.  
  56.     /**
  57.      * Get id
  58.      *
  59.      * @return integer
  60.      */
  61.     public function getId() {
  62.         return $this->id;
  63.     }
  64.  
  65.     /**
  66.      * Set name
  67.      *
  68.      * @param string $name
  69.      * @return Author
  70.      */
  71.     public function setName($name) {
  72.         $this->name = $name;
  73.  
  74.         return $this;
  75.     }
  76.  
  77.     /**
  78.      * Get name
  79.      *
  80.      * @return string
  81.      */
  82.     public function getName() {
  83.         return $this->name;
  84.     }
  85.  
  86.     /**
  87.      * Set surname
  88.      *
  89.      * @param string $surname
  90.      * @return Author
  91.      */
  92.     public function setSurname($surname) {
  93.         $this->surname = $surname;
  94.  
  95.         return $this;
  96.     }
  97.  
  98.     /**
  99.      * Get surname
  100.      *
  101.      * @return string
  102.      */
  103.     public function getSurname() {
  104.         return $this->surname;
  105.     }
  106.  
  107.     /**
  108.      * Set description
  109.      *
  110.      * @param string $description
  111.      * @return Author
  112.      */
  113.     public function setDescription($description) {
  114.         $this->description = $description;
  115.  
  116.         return $this;
  117.     }
  118.  
  119.     /**
  120.      * Get description
  121.      *
  122.      * @return string
  123.      */
  124.     public function getDescription() {
  125.         return $this->description;
  126.     }
  127.  
  128. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement