%PDF- %PDF-
Direktori : /home/emtnaeewxm/www/src/EEM/AchatBundle/Entity/ |
Current File : /home/emtnaeewxm/www/src/EEM/AchatBundle/Entity/Achat.php~ |
<?php namespace EEM\AchatBundle\Entity; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Validator\Constraints as Assert; /** * Achat * * @ORM\Table(name="achat") * @ORM\Entity(repositoryClass="EEM\AchatBundle\Repository\AchatRepository") */ class Achat { /** * @var int * * @ORM\Column(name="id", type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") */ private $id; /** * @var \DateTime * * @ORM\Column(name="dateAchat", type="date", nullable=true) */ private $dateAchat; /** * @ORM\OneToMany(targetEntity="EEM\AchatBundle\Entity\LigneAchat", mappedBy="achat",cascade={"persist", "remove"}) * * @var ArrayCollection */ private $ligneAchats; /** * @ORM\OneToMany(targetEntity="EEM\AchatBundle\Entity\Reglement", mappedBy="achat",cascade={"persist", "remove"}) * * @var ArrayCollection */ private $reglements; /** * @var string * * @ORM\ManyToOne(targetEntity="EEM\AchatBundle\Entity\Fournisseur" , inversedBy="achats") * @ORM\JoinColumn(name="fournisseur_id") * @Assert\NotBlank(message="Choisissez un fournisseur") */ private $fournisseur; /** * @var string * * @ORM\Column(name="type_achat", type="string", length=255, nullable=true) */ private $type; /** * @ORM\OneToMany(targetEntity="EEM\FonctionnaliteBundle\Entity\Historique", mappedBy="achat",cascade={"persist", "remove"}) * * @var ArrayCollection */ private $historiques; /** * Get id * * @return int */ public function getId() { return $this->id; } /** * Set dateAchat * * @param \DateTime $dateAchat * * @return Achat */ public function setDateAchat($dateAchat) { $this->dateAchat = $dateAchat; return $this; } /** * Get dateAchat * * @return \DateTime */ public function getDateAchat() { return $this->dateAchat; } /** * Constructor */ public function __construct() { $this->ligneAchats = new \Doctrine\Common\Collections\ArrayCollection(); } /** * Add ligneAchat * * @param \EEM\AchatBundle\Entity\LigneAchat $ligneAchat * * @return Achat */ public function addLigneAchat(\EEM\AchatBundle\Entity\LigneAchat $ligneAchat) { $this->ligneAchats[] = $ligneAchat; $ligneAchat->setAchat($this); return $this; } /** * Remove ligneAchat * * @param \EEM\AchatBundle\Entity\LigneAchat $ligneAchat */ public function removeLigneAchat(\EEM\AchatBundle\Entity\LigneAchat $ligneAchat) { $this->ligneAchats->removeElement($ligneAchat); } /** * Get ligneAchats * * @return \Doctrine\Common\Collections\Collection */ public function getLigneAchats() { return $this->ligneAchats; } /** * Set fournisseur * * @param \EEM\AchatBundle\Entity\Fournisseur $fournisseur * * @return Achat */ public function setFournisseur(\EEM\AchatBundle\Entity\Fournisseur $fournisseur = null) { $this->fournisseur = $fournisseur; return $this; } /** * Get fournisseur * * @return \EEM\AchatBundle\Entity\Fournisseur */ public function getFournisseur() { return $this->fournisseur; } /** * Add reglement * * @param \EEM\AchatBundle\Entity\Reglement $reglement * * @return Achat */ public function addReglement(\EEM\AchatBundle\Entity\Reglement $reglement) { $this->reglements[] = $reglement; return $this; } /** * Remove reglement * * @param \EEM\AchatBundle\Entity\Reglement $reglement */ public function removeReglement(\EEM\AchatBundle\Entity\Reglement $reglement) { $this->reglements->removeElement($reglement); } /** * Get reglements * * @return \Doctrine\Common\Collections\Collection */ public function getReglements() { return $this->reglements; } /** * Set type * * @param string $type * * @return Achat */ public function setType($type) { $this->type = $type; return $this; } /** * Get type * * @return string */ public function getType() { return $this->type; } }