Commit 092adf2c authored by Mat's avatar Mat
Browse files

Ajout des entités Groupe et Depot, génère les getters, déclare attributs et relations

parent 0ed10472
<?php
namespace PotageBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Depot
*
* @ORM\Table(name="depot")
* @ORM\Entity(repositoryClass="PotageBundle\Repository\DepotRepository")
* @ORM\HasLifecycleCallbacks()
*/
class Depot
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var
* @ORM\OneToOne(targetEntity="PotageBundle\Entity\Groupe", mappedBy="depot")
*/
private $groupe;
/**
* @var string
* @ORM\Column(name="localisation", type="string", length=100)
*/
private $localisation;
// /**
// * @var integer
// * @ORM\OneToOne(targetEntity="PotageBundle\Entity\Utilisateur", inversedBy="depot")
// * @ORM\JoinColumn(name="id_responsable", referencedColumnName="id")
// */
// private $responsable;
/**
* @var integer
* @ORM\Column(name="jour_panier", type="integer", length=1)
*/
private $jourPanier;
/**
* @var \DateTime
* @ORM\Column(name="heure_panier", type="DateTime")
*/
private $heurePanier;
/**
* @var \DateTime
*
* @ORM\Column(name="created_at", type="datetime")
*/
private $createdAt;
/**
* @var \DateTime
*
* @ORM\Column(name="updated_at", type="datetime", nullable=true)
*/
private $updatedAt;
/**
*
* @ORM\PrePersist()
*/
public function prePersist()
{
$this->createdAt = new \DateTime();
}
/**
*
* @ORM\PreUpdate()
*/
public function preUpdate()
{
$this->updatedAt = new \DateTime();
}
/**
* Get id
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set localisation
*
* @param string $localisation
*
* @return Depot
*/
public function setLocalisation($localisation)
{
$this->localisation = $localisation;
return $this;
}
/**
* Get localisation
*
* @return string
*/
public function getLocalisation()
{
return $this->localisation;
}
/**
* Set jourPanier
*
* @param integer $jourPanier
*
* @return Depot
*/
public function setJourPanier($jourPanier)
{
$this->jourPanier = $jourPanier;
return $this;
}
/**
* Get jourPanier
*
* @return integer
*/
public function getJourPanier()
{
return $this->jourPanier;
}
/**
* Set heurePanier
*
* @param \DateTime $heurePanier
*
* @return Depot
*/
public function setHeurePanier(\DateTime $heurePanier)
{
$this->heurePanier = $heurePanier;
return $this;
}
/**
* Get heurePanier
*
* @return \DateTime
*/
public function getHeurePanier()
{
return $this->heurePanier;
}
/**
* Set createdAt
*
* @param \DateTime $createdAt
*
* @return Depot
*/
public function setCreatedAt($createdAt)
{
$this->createdAt = $createdAt;
return $this;
}
/**
* Get createdAt
*
* @return \DateTime
*/
public function getCreatedAt()
{
return $this->createdAt;
}
/**
* Set updatedAt
*
* @param \DateTime $updatedAt
*
* @return Depot
*/
public function setUpdatedAt($updatedAt)
{
$this->updatedAt = $updatedAt;
return $this;
}
/**
* Get updatedAt
*
* @return \DateTime
*/
public function getUpdatedAt()
{
return $this->updatedAt;
}
/**
* Set groupe
*
* @param \PotageBundle\Entity\Groupe $groupe
*
* @return Depot
*/
public function setGroupe(\PotageBundle\Entity\Groupe $groupe = null)
{
$this->groupe = $groupe;
return $this;
}
/**
* Get groupe
*
* @return \PotageBundle\Entity\Groupe
*/
public function getGroupe()
{
return $this->groupe;
}
}
<?php
namespace PotageBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Groupe
*
* @ORM\Table(name="groupe")
* @ORM\Entity(repositoryClass="PotageBundle\Repository\GroupeRepository")
* @ORM\HasLifecycleCallbacks()
*/
class Groupe
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var Lettre[]
* @ORM\OneToMany(targetEntity="PotageBundle\Entity\Lettre", mappedBy="groupe")
*/
private $lettres;
/**
* @var
* @ORM\OneToOne(targetEntity="PotageBundle\Entity\Depot", inversedBy="groupe")
* @ORM\JoinColumn(name="id_depot", referencedColumnName="id")
*/
private $depot;
/**
* @var string
*
* @ORM\Column(name="nom", type="string", length=100)
*/
private $nom;
/**
* @ORM\Column(length=128, unique=true)
*/
private $slug;
/**
* @var string
*
* @ORM\Column(name="description", type="text")
*/
private $description;
/**
* @var \DateTime
*
* @ORM\Column(name="created_at", type="datetime")
*/
private $createdAt;
/**
* @var \DateTime
*
* @ORM\Column(name="updated_at", type="datetime", nullable=true)
*/
private $updatedAt;
/**
*
* @ORM\PrePersist()
*/
public function prePersist()
{
$this->createdAt = new \DateTime();
}
/**
*
* @ORM\PreUpdate()
*/
public function preUpdate()
{
$this->updatedAt = new \DateTime();
}
/**
* Get id
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Constructor
*/
public function __construct()
{
$this->lettres = new \Doctrine\Common\Collections\ArrayCollection();
}
/**
* Set nom
*
* @param string $nom
*
* @return Groupe
*/
public function setNom($nom)
{
$this->nom = $nom;
return $this;
}
/**
* Get nom
*
* @return string
*/
public function getNom()
{
return $this->nom;
}
/**
* Set slug
*
* @param string $slug
*
* @return Groupe
*/
public function setSlug($slug)
{
$this->slug = $slug;
return $this;
}
/**
* Get slug
*
* @return string
*/
public function getSlug()
{
return $this->slug;
}
/**
* Set description
*
* @param string $description
*
* @return Groupe
*/
public function setDescription($description)
{
$this->description = $description;
return $this;
}
/**
* Get description
*
* @return string
*/
public function getDescription()
{
return $this->description;
}
/**
* Set createdAt
*
* @param \DateTime $createdAt
*
* @return Groupe
*/
public function setCreatedAt($createdAt)
{
$this->createdAt = $createdAt;
return $this;
}
/**
* Get createdAt
*
* @return \DateTime
*/
public function getCreatedAt()
{
return $this->createdAt;
}
/**
* Set updatedAt
*
* @param \DateTime $updatedAt
*
* @return Groupe
*/
public function setUpdatedAt($updatedAt)
{
$this->updatedAt = $updatedAt;
return $this;
}
/**
* Get updatedAt
*
* @return \DateTime
*/
public function getUpdatedAt()
{
return $this->updatedAt;
}
/**
* Add lettre
*
* @param \PotageBundle\Entity\Lettre $lettre
*
* @return Groupe
*/
public function addLettre(\PotageBundle\Entity\Lettre $lettre)
{
$this->lettres[] = $lettre;
return $this;
}
/**
* Remove lettre
*
* @param \PotageBundle\Entity\Lettre $lettre
*/
public function removeLettre(\PotageBundle\Entity\Lettre $lettre)
{
$this->lettres->removeElement($lettre);
}
/**
* Get lettres
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getLettres()
{
return $this->lettres;
}
/**
* Set depot
*
* @param \PotageBundle\Entity\Depot $depot
*
* @return Groupe
*/
public function setDepot(\PotageBundle\Entity\Depot $depot = null)
{
$this->depot = $depot;
return $this;
}
/**
* Get depot
*
* @return \PotageBundle\Entity\Depot
*/
public function getDepot()
{
return $this->depot;
}
}
......@@ -42,7 +42,8 @@ class Lettre
/**
* @var int
* @ORM\Column(name="id_groupe", type="integer", nullable=false)
* @ORM\ManyToOne(targetEntity="PotageBundle\Entity\Groupe", inversedBy="lettres")
* @ORM\JoinColumn(name="id_groupe", nullable=false)
*/
private $groupe;
......
<?php
namespace PotageBundle\Repository;
/**
* DepotRepository
*
* This class was generated by the Doctrine ORM. Add your own custom
* repository methods below.
*/
class DepotRepository extends \Doctrine\ORM\EntityRepository
{
}
<?php
namespace PotageBundle\Repository;
/**
* GroupeRepository
*
* This class was generated by the Doctrine ORM. Add your own custom
* repository methods below.
*/
class GroupeRepository extends \Doctrine\ORM\EntityRepository
{
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment