src/Entity/Editeurs.php line 17

Open in your IDE?
  1. <?php
  2. /**
  3.  * Created by PhpStorm.
  4.  * User: sbrun
  5.  * Date: 2018-03-26
  6.  * Time: 1:36 PM
  7.  */
  8. namespace App\Entity;
  9. use Doctrine\ORM\Mapping as ORM;
  10. /**
  11.  * @ORM\Entity
  12.  * @ORM\Table(name="tediteurs")
  13.  * @ORM\Entity(repositoryClass="App\Repository\EditeursRepository")
  14.  */
  15. class Editeurs
  16. {
  17.     /**
  18.      * @ORM\Column(type="integer")
  19.      * @ORM\Id
  20.      * @ORM\GeneratedValue(strategy="AUTO")
  21.      */
  22.     protected $id;
  23.     /**
  24.      * @ORM\Column(name="eediteur", type="string", length=50, nullable=true)
  25.      */
  26.     protected $editeur;
  27.     /**
  28.      * @ORM\Column(name="enom", type="string", length=255, nullable=true)
  29.      */
  30.     protected $nom;
  31.     /**
  32.      * @ORM\Column(name="enominternet", type="string", length=50, nullable=true)
  33.      */
  34.     protected $nomInternet;
  35.     /**
  36.      * @ORM\Column(name="ecanadien", type="integer", nullable=true)
  37.      */
  38.     protected $canadien;
  39.     /**
  40.      * @ORM\Column(name="eville", type="string", length=75, nullable=true)
  41.      */
  42.     protected $ville;
  43.     /**
  44.      * @ORM\Column(name="quebec", type="boolean")
  45.      */
  46.     protected $quebec true;
  47.     /**
  48.      * @ORM\Column(name="eactive", type="boolean", nullable=true)
  49.      */
  50.     protected $active;
  51.     /**
  52.      * Many Editeurs has one Fournisseurs
  53.      *
  54.      * @ORM\ManyToOne(targetEntity="App\Entity\Fournisseurs", cascade={"persist"}, inversedBy="editeurs")
  55.      * @ORM\JoinColumn(name="ediffuseur", referencedColumnName="id", nullable=true)
  56.      */
  57.     protected $fournisseur;
  58.     /**
  59.      * has one Genre
  60.      *
  61.      * @ORM\ManyToOne(targetEntity="App\Entity\EditeursGenre", cascade={"persist"})
  62.      * @ORM\JoinColumn(name="genre_id", referencedColumnName="id", nullable=true)
  63.      */
  64.     protected $genre;
  65.     /**
  66.      * @ORM\OneToMany(targetEntity="App\Entity\Titre", mappedBy="editeur")
  67.      */
  68.     private $titres;
  69.     public function setId($id) {
  70.         $this->id $id;
  71.     }
  72.     /**
  73.      * @return mixed
  74.      */
  75.     public function getId()
  76.     {
  77.         return $this->id;
  78.     }
  79.     /**
  80.      * @return mixed
  81.      */
  82.     public function getNom()
  83.     {
  84.         return $this->nom;
  85.     }
  86.     /**
  87.      * @param mixed $nom
  88.      * @return Editeurs
  89.      */
  90.     public function setNom($nom)
  91.     {
  92.         $this->nom $nom;
  93.         return $this;
  94.     }
  95.     /**
  96.      * @return mixed
  97.      */
  98.     public function getVille()
  99.     {
  100.         return $this->ville;
  101.     }
  102.     /**
  103.      * @param mixed $ville
  104.      */
  105.     public function setVille($ville)
  106.     {
  107.         $this->ville $ville;
  108.     }
  109.     /**
  110.      * @return mixed
  111.      */
  112.     public function getEditeur()
  113.     {
  114.         return $this->editeur;
  115.     }
  116.     /**
  117.      * @param mixed $editeur
  118.      */
  119.     public function setEditeur($editeur)
  120.     {
  121.         $this->editeur $editeur;
  122.     }
  123.     /**
  124.      * @return \App\Entity\Fournisseurs
  125.      */
  126.     public function getFournisseur()
  127.     {
  128.         return $this->fournisseur;
  129.     }
  130.     /**
  131.      * @param $fournisseur
  132.      * @return Editeurs
  133.      */
  134.     public function setFournisseur($fournisseur)
  135.     {
  136.         $this->fournisseur $fournisseur;
  137.         return $this;
  138.     }
  139.     /**
  140.      * @return mixed
  141.      */
  142.     public function getActive()
  143.     {
  144.         return $this->active;
  145.     }
  146.     /**
  147.      * @param mixed $active
  148.      */
  149.     public function setActive($active)
  150.     {
  151.         $this->active $active;
  152.     }
  153.     /**
  154.      * @return bool
  155.      */
  156.     public function isActive()
  157.     {
  158.         return $this->getActive()?true:false;
  159.     }
  160.     /**
  161.      * @return mixed
  162.      */
  163.     public function getNomInternet()
  164.     {
  165.         return $this->nomInternet;
  166.     }
  167.     /**
  168.      * @param mixed $nomInternet
  169.      */
  170.     public function setNomInternet($nomInternet)
  171.     {
  172.         $this->nomInternet $nomInternet;
  173.     }
  174.     /**
  175.      * @return mixed
  176.      */
  177.     public function getCanadien()
  178.     {
  179.         return $this->canadien;
  180.     }
  181.     /**
  182.      * @param mixed $canadien
  183.      */
  184.     public function setCanadien($canadien)
  185.     {
  186.         $this->canadien $canadien;
  187.     }
  188.     /**
  189.      * @return array
  190.      */
  191.     public function getTitres()
  192.     {
  193.         return $this->titres;
  194.     }
  195.     /**
  196.      * @param array $titres
  197.      */
  198.     public function setTitres($titres)
  199.     {
  200.         $this->titres $titres;
  201.     }
  202.     /**
  203.      * @return mixed
  204.      */
  205.     public function getGenre()
  206.     {
  207.         return $this->genre;
  208.     }
  209.     /**
  210.      * @param mixed $genre
  211.      * @return Editeurs
  212.      */
  213.     public function setGenre($genre)
  214.     {
  215.         $this->genre $genre;
  216.         return $this;
  217.     }
  218.     public function __toString()
  219.     {
  220.         if (empty($this->getNom())) {
  221.             return 'Inconnu';
  222.         }
  223.         return $this->getNom();
  224.     }
  225.     /**
  226.      * @return bool
  227.      */
  228.     public function isQuebec(): bool
  229.     {
  230.         return $this->quebec;
  231.     }
  232.     /**
  233.      * @param bool $quebec
  234.      * @return Editeurs
  235.      */
  236.     public function setQuebec(bool $quebec): Editeurs
  237.     {
  238.         $this->quebec $quebec;
  239.         return $this;
  240.     }
  241. }