%PDF- %PDF-
Direktori : /home/emtnaeewxm/www/src/EEM/PieceBundle/Entity/ |
Current File : /home/emtnaeewxm/www/src/EEM/PieceBundle/Entity/Piece.php~ |
<?php namespace EEM\PieceBundle\Entity; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Validator\Constraints as Assert; /** * Piece * * @ORM\Table(name="piece") * @ORM\Entity(repositoryClass="EEM\PieceBundle\Repository\PieceRepository") */ class Piece { /** * @var int * * @ORM\Column(name="id", type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") */ private $id; /** * @var \DateTime * * @ORM\Column(name="date_piece", type="date", nullable=true) */ private $datePiece; /** * @var string * * @ORM\Column(name="type_piece", type="string", length=255, nullable=true) */ private $typePiece; /** * @var string * * @ORM\ManyToOne(targetEntity="EEM\TraiteBundle\Entity\Client" , inversedBy="pieces") * @ORM\JoinColumn(name="client_id") * @Assert\NotBlank(message="Choisissez un client") */ private $client; /** * @ORM\OneToOne(targetEntity="EEM\VenteBundle\Entity\Vente", mappedBy="piece", cascade={"persist"}) */ private $venteGros; /** * @ORM\OneToMany(targetEntity="EEM\PieceBundle\Entity\LignePiece", mappedBy="piece",cascade={"persist", "remove"}) * * @var ArrayCollection */ private $lignePieces; /** * @var int * * @ORM\Column(name="num", type="integer", nullable=true) */ private $num; /** * @var int * * @ORM\Column(name="annee", type="integer", nullable=true) */ private $annee; public function liste_type_piece() { return [ 'bon_livraison' => [ 'name' => 'Bon de livraison', 'abrv' => 'BL' ], 'devis' => [ 'name' => 'Devis', 'abrv' => 'DEV' ], 'facture' => [ 'name' => 'Facture', 'abrv' => 'FACT' ], ]; } /** * Get id * * @return int */ public function getId() { return $this->id; } /** * Set datePiece * * @param \DateTime $datePiece * * @return Piece */ public function setDatePiece($datePiece) { $this->datePiece = $datePiece; return $this; } /** * Get datePiece * * @return \DateTime */ public function getDatePiece() { return $this->datePiece; } /** * Set typePiece * * @param string $typePiece * * @return Piece */ public function setTypePiece($typePiece) { $this->typePiece = $typePiece; return $this; } /** * Get typePiece * * @return string */ public function getTypePiece() { return $this->typePiece; } /** * Constructor */ public function __construct() { $this->lignePieces = new \Doctrine\Common\Collections\ArrayCollection(); } /** * Set client * * @param \EEM\TraiteBundle\Entity\Client $client * * @return Piece */ public function setClient(\EEM\TraiteBundle\Entity\Client $client = null) { $this->client = $client; return $this; } /** * Get client * * @return \EEM\TraiteBundle\Entity\Client */ public function getClient() { return $this->client; } /** * Add lignePiece * * @param \EEM\PieceBundle\Entity\LignePiece $lignePiece * * @return Piece */ public function addLignePiece(\EEM\PieceBundle\Entity\LignePiece $lignePiece) { $this->lignePieces[] = $lignePiece; $lignePiece->setPiece($this); return $this; } /** * Remove lignePiece * * @param \EEM\PieceBundle\Entity\LignePiece $lignePiece */ public function removeLignePiece(\EEM\PieceBundle\Entity\LignePiece $lignePiece) { $this->lignePieces->removeElement($lignePiece); } /** * Get lignePieces * * @return \Doctrine\Common\Collections\Collection */ public function getLignePieces() { return $this->lignePieces; } /** * Set num * * @param integer $num * * @return Piece */ public function setNum($num) { $this->num = $num; return $this; } /** * Get num * * @return integer */ public function getNum() { return $this->num; } /** * Set annee * * @param integer $annee * * @return Piece */ public function setAnnee($annee) { $this->annee = $annee; return $this; } /** * Get annee * * @return integer */ public function getAnnee() { return $this->annee; } }