src/Entity/Produit/Service/Service.php line 27

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Produit\Service;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use App\Validator\Validatortext\Taillemin;
  5. use App\Validator\Validatortext\Taillemax;
  6. use App\Service\Servicetext\GeneralServicetext;
  7. use App\Validator\Validatortext\Siteweb;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9. use App\Repository\Produit\Service\ServiceRepository;
  10. use App\Entity\Users\User\User;
  11. use App\Entity\Produit\Produit\Souscategorie;
  12. use App\Entity\Produit\Service\Imgservice;
  13. use App\Entity\Produit\Service\Evenement;
  14. use App\Entity\Produit\Service\Commentaireblog;
  15. use App\Entity\Produit\Service\Typearticle;
  16. use App\Entity\Produit\Service\Ressourcearticle;
  17. use Doctrine\Common\Collections\Collection;
  18. /**
  19.  * Service
  20.  *
  21.  * @ORM\Table("service")
  22.  * @ORM\Entity(repositoryClass=ServiceRepository::class)
  23.  */
  24. class Service
  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.      * @var string
  36.      *
  37.      * @ORM\Column(name="nom", type="string", length=255)
  38.      *@Taillemin(valeur=3, message="Au moins 3 caractères")
  39.      *@Taillemax(valeur=200, message="Au plus 200 caractès")
  40.      */
  41.     private $nom;
  42.     /**
  43.      * @var string
  44.      *
  45.      * @ORM\Column(name="description", type="text")
  46.      *@Taillemin(valeur=3, message="Au moins 3 caractères")
  47.      *@Taillemax(valeur=1000, message="Au plus 1000 caractès")
  48.      */
  49.     private $description;
  50.     
  51.     /**
  52.      * @var string
  53.      *
  54.      * @ORM\Column(name="breve", type="string", length=255, nullable=true)
  55.      *@Taillemin(valeur=3, message="Au moins 3 caractères")
  56.      *@Taillemax(valeur=40, message="Au plus 40 caractès")
  57.      */
  58.     private $breve;
  59.     
  60.     /**
  61.      * @var string
  62.      *
  63.      * @ORM\Column(name="keyword", type="string", length=255, nullable=true)
  64.      *@Taillemax(valeur=250, message="Au plus 250 caractès")
  65.      */
  66.     private $keyword;
  67.     
  68.     /**
  69.      * @var string
  70.      *
  71.      * @ORM\Column(name="link", type="string", length=255, nullable=true)
  72.      *@Siteweb()
  73.      */
  74.     private $link;
  75.     
  76.     /**
  77.      * @var string
  78.      *
  79.      * @ORM\Column(name="nomcompte", type="string", length=255, nullable=true)
  80.      */
  81.     private $nomcompte;
  82.     
  83.     /**
  84.      * @var string
  85.      *
  86.      * @ORM\Column(name="numcompte", type="string", length=255, nullable=true)
  87.      */
  88.     private $numcompte;
  89.     /**
  90.      * @var integer
  91.      *
  92.      * @ORM\Column(name="rang", type="integer")
  93.      */
  94.     private $rang;
  95.     
  96.     /**
  97.      * @var boolean
  98.      *
  99.      * @ORM\Column(name="principal", type="boolean")
  100.      */
  101.     private $principal;
  102.     /**
  103.      * @var \DateTime
  104.      *
  105.      * @ORM\Column(name="date", type="datetime")
  106.      */
  107.     private $date;
  108.     
  109.     /**
  110.      * @ORM\ManyToOne(targetEntity=User::class)
  111.      * @ORM\JoinColumn(nullable=false)
  112.      */
  113.     private $user;
  114.     
  115.     /**
  116.      * @ORM\ManyToOne(targetEntity=Souscategorie::class)
  117.      * @ORM\JoinColumn(nullable=true)
  118.      */
  119.     private $souscategorie;
  120.     
  121.     /**
  122.      * @ORM\OneToOne(targetEntity=Imgservice::class,  cascade={"persist","remove"})
  123.      * @ORM\JoinColumn(nullable=true)
  124.      *@Assert\Valid()
  125.     */
  126.     private $imgservice;
  127.     
  128.     /**
  129.      * @ORM\OneToMany(targetEntity=Evenement::class, mappedBy="service")
  130.      */
  131.     private $evenements;
  132.     
  133.     /**
  134.      * @ORM\OneToMany(targetEntity=Commentaireblog::class, mappedBy="service")
  135.     */
  136.     private $commentaireblogs;
  137.     
  138.     /**
  139.      * @ORM\OneToMany(targetEntity=Ressourcearticle::class, mappedBy="service")
  140.     */
  141.     private $ressourcearticles;
  142.     
  143.     /**
  144.      * @var string
  145.      *
  146.      * @ORM\Column(name="typearticle", type="string", length=255)
  147.     */
  148.     private $typearticle;
  149.     
  150.     /**
  151.      * @ORM\ManyToOne(targetEntity=Typearticle::class, inversedBy="services")
  152.      * @ORM\JoinColumn(nullable=true)
  153.      */
  154.     private $type;
  155.     
  156.     
  157.     // variable du service de normalisation des noms des pays.
  158.     private $servicetext;
  159.     
  160.     private $em;
  161.     /**
  162.      * @ORM\Column(type="datetime", nullable=true)
  163.      */
  164.     private $dateEvent;
  165.     
  166.     public function __construct(GeneralServicetext $service)
  167.              {
  168.                  $this->servicetext $service;
  169.                  $this->date = new \Datetime();
  170.                  $this->principal false;
  171.                  $this->evenements = new \Doctrine\Common\Collections\ArrayCollection();
  172.                  $this->commentaireblogs = new \Doctrine\Common\Collections\ArrayCollection();
  173.                  $this->ressourcearticles = new \Doctrine\Common\Collections\ArrayCollection();
  174.              }
  175.     public function setServicetextGeneralServicetext $service)
  176.              {
  177.                  $this->servicetext $service;
  178.              }
  179.     
  180.     public function getServicetext()
  181.     {
  182.         return $this->servicetext;
  183.     }
  184.     
  185.     public function setEm($em)
  186.              {
  187.                  $this->em $em;
  188.              }
  189.     
  190.     public function getEm()
  191.              {
  192.                  return $this->em;
  193.              }
  194.     /**
  195.      * Get id
  196.      *
  197.      * @return integer 
  198.     */
  199.     public function getId()
  200.     {
  201.         return $this->id;
  202.     }
  203.     /**
  204.      * Set nom
  205.      *
  206.      * @param string $nom
  207.      * @return Service
  208.      */
  209.     public function setNom($nom)
  210.     {
  211.         $this->nom $nom;
  212.         return $this;
  213.     }
  214.     /**
  215.      * Get nom
  216.      *
  217.      * @return string 
  218.      */
  219.     public function getNom()
  220.     {
  221.         return $this->nom;
  222.     }
  223.     /**
  224.      * Set description
  225.      *
  226.      * @param string $description
  227.      * @return Service
  228.      */
  229.     public function setDescription($description)
  230.     {
  231.         $this->description $description;
  232.         return $this;
  233.     }
  234.     /**
  235.      * Get description
  236.      *
  237.      * @return string 
  238.      */
  239.     public function getDescription()
  240.     {
  241.         return $this->description;
  242.     }
  243.     /**
  244.      * Set date
  245.      *
  246.      * @param \DateTime $date
  247.      * @return Service
  248.      */
  249.     public function setDate($date)
  250.     {
  251.         $this->date $date;
  252.         return $this;
  253.     }
  254.     /**
  255.      * Get date
  256.      *
  257.      * @return \DateTime 
  258.      */
  259.     public function getDate()
  260.     {
  261.         return $this->date;
  262.     }
  263.     /**
  264.      * Set user
  265.      * @return Service
  266.      */
  267.     public function setUser(User $user): self
  268.     {
  269.         $this->user $user;
  270.         return $this;
  271.     }
  272.     /**
  273.      * Get user
  274.      */
  275.     public function getUser(): ?User
  276.     {
  277.         return $this->user;
  278.     }
  279.     /**
  280.      * Set imgservice
  281.      * @return Service
  282.      */
  283.     public function setImgservice(Imgservice $imgservice): self
  284.     {
  285.         $this->imgservice $imgservice;
  286.         return $this;
  287.     }
  288.     /**
  289.      * Get imgservice
  290.      */
  291.     public function getImgservice(): ?Imgservice
  292.     {
  293.         return $this->imgservice;
  294.     }
  295.     /**
  296.      * Add evenements
  297.      * @return Service
  298.      */
  299.     public function addEvenement(Evenement $evenements): self
  300.     {
  301.         $this->evenements[] = $evenements;
  302.         return $this;
  303.     }
  304.     /**
  305.      * Remove evenements
  306.      */
  307.     public function removeEvenement(Evenement $evenements)
  308.     {
  309.         $this->evenements->removeElement($evenements);
  310.     }
  311.     /**
  312.      * Get evenements 
  313.      */
  314.     public function getEvenements(): ?Collection
  315.     {
  316.         return $this->evenements;
  317.     }
  318.     /**
  319.      * Add commentaireblogs
  320.      * @return Service
  321.      */
  322.     public function addCommentaireblog(Commentaireblog $commentaireblogs): self
  323.     {
  324.         $this->commentaireblogs[] = $commentaireblogs;
  325.         return $this;
  326.     }
  327.     /**
  328.      * Remove commentaireblogs
  329.      */
  330.     public function removeCommentaireblog(Commentaireblog $commentaireblogs)
  331.     {
  332.         $this->commentaireblogs->removeElement($commentaireblogs);
  333.     }
  334.     /**
  335.      * Get commentaireblogs
  336.      */
  337.     public function getCommentaireblogs(): ?Collection
  338.     {
  339.         return $this->commentaireblogs;
  340.     }
  341.     /**
  342.      * Set typearticle
  343.      *
  344.      * @param string $typearticle
  345.      * @return Service
  346.      */
  347.     public function setTypearticle($typearticle)
  348.     {
  349.         $this->typearticle $typearticle;
  350.         return $this;
  351.     }
  352.     /**
  353.      * Get typearticle
  354.      *
  355.      * @return string 
  356.      */
  357.     public function getTypearticle()
  358.     {
  359.         return $this->typearticle;
  360.     }
  361.     /**
  362.      * Set type
  363.      * @return Service
  364.      */
  365.     public function setType(Typearticle $type null): self
  366.     {
  367.         $this->type $type;
  368.         if($type != null)
  369.         {
  370.             $type->addService($this);
  371.         }
  372.         return $this;
  373.     }
  374.     /**
  375.      * Get type
  376.      */
  377.     public function getType(): ?Typearticle
  378.     {
  379.         return $this->type;
  380.     }
  381.     
  382.     /**
  383.      * Set breve
  384.      *
  385.      * @param string $breve
  386.      * @return Service
  387.      */
  388.     public function setBreve($breve)
  389.     {
  390.         $this->breve $breve;
  391.         return $this;
  392.     }
  393.     /**
  394.      * Get breve
  395.      *
  396.      * @return string 
  397.      */
  398.     public function getBreve()
  399.     {
  400.         return $this->breve;
  401.     }
  402.     /**
  403.      * Set keyword
  404.      *
  405.      * @param string $keyword
  406.      * @return Service
  407.      */
  408.     public function setKeyword($keyword)
  409.     {
  410.         $this->keyword $keyword;
  411.         return $this;
  412.     }
  413.     /**
  414.      * Get keyword
  415.      *
  416.      * @return string 
  417.      */
  418.     public function getKeyword()
  419.     {
  420.         return $this->keyword;
  421.     }
  422.     /**
  423.      * Set link
  424.      *
  425.      * @param string $link
  426.      * @return Service
  427.      */
  428.     public function setLink($link)
  429.     {
  430.         $this->link $link;
  431.         return $this;
  432.     }
  433.     /**
  434.      * Get link
  435.      *
  436.      * @return string 
  437.      */
  438.     public function getLink()
  439.     {
  440.         return $this->link;
  441.     }
  442.     /**
  443.      * Set nomcompte
  444.      *
  445.      * @param string $nomcompte
  446.      * @return Service
  447.      */
  448.     public function setNomcompte($nomcompte)
  449.     {
  450.         $this->nomcompte $nomcompte;
  451.         return $this;
  452.     }
  453.     /**
  454.      * Get nomcompte
  455.      *
  456.      * @return string 
  457.      */
  458.     public function getNomcompte()
  459.     {
  460.         return $this->nomcompte;
  461.     }
  462.     /**
  463.      * Set numcompte
  464.      *
  465.      * @param string $numcompte
  466.      * @return Service
  467.      */
  468.     public function setNumcompte($numcompte)
  469.     {
  470.         $this->numcompte $numcompte;
  471.         return $this;
  472.     }
  473.     /**
  474.      * Get numcompte
  475.      *
  476.      * @return string 
  477.      */
  478.     public function getNumcompte()
  479.     {
  480.         return $this->numcompte;
  481.     }
  482.     /**
  483.      * Set rang
  484.      *
  485.      * @param integer $rang
  486.      * @return Service
  487.      */
  488.     public function setRang($rang)
  489.     {
  490.         $this->rang $rang;
  491.         return $this;
  492.     }
  493.     /**
  494.      * Get rang
  495.      *
  496.      * @return integer 
  497.      */
  498.     public function getRang()
  499.     {
  500.         return $this->rang;
  501.     }
  502.     /**
  503.      * Set souscategorie
  504.      * @return Service
  505.      */
  506.     public function setSouscategorie(Souscategorie $souscategorie null): self
  507.     {
  508.         $this->souscategorie $souscategorie;
  509.         return $this;
  510.     }
  511.     /**
  512.      * Get souscategorie 
  513.     */
  514.     
  515.     public function getSouscategorie(): ?Souscategorie
  516.     {
  517.         return $this->souscategorie;
  518.     }
  519.     
  520.     public function getPartiearticles()
  521.              {
  522.                  $liste_partie $this->em->getRepository(Evenement::class)
  523.                                       ->findBy(array('service'=>$this'typearticle'=>'autres'),array('rang'=>'asc'));
  524.                  return $liste_partie;
  525.              }
  526.     /**
  527.      * Set principal
  528.      *
  529.      * @param boolean $principal
  530.      * @return Service
  531.     */
  532.     
  533.     public function setPrincipal($principal)
  534.     {
  535.         $this->principal $principal;
  536.         return $this;
  537.     }
  538.     /**
  539.      * Get principal
  540.      *
  541.      * @return boolean 
  542.     */
  543.     
  544.     public function getPrincipal()
  545.     {
  546.         return $this->principal;
  547.     }
  548.     /**
  549.      * Add ressourcearticles
  550.      * @return Service
  551.      */
  552.     public function addRessourcearticle(Ressourcearticle $ressourcearticles): self
  553.     {
  554.         $this->ressourcearticles[] = $ressourcearticles;
  555.         return $this;
  556.     }
  557.     /**
  558.      * Remove ressourcearticles
  559.      */
  560.     public function removeRessourcearticle(Ressourcearticle $ressourcearticles)
  561.     {
  562.         $this->ressourcearticles->removeElement($ressourcearticles);
  563.     }
  564.     /**
  565.      * Get ressourcearticles
  566.      */
  567.     public function getRessourcearticles(): ?Collection
  568.     {
  569.         return $this->ressourcearticles;
  570.     }
  571.     public function getDateEvent(): ?\DateTimeInterface
  572.     {
  573.         return $this->dateEvent;
  574.     }
  575.     public function setDateEvent(?\DateTimeInterface $dateEvent): self
  576.     {
  577.         $this->dateEvent $dateEvent;
  578.         return $this;
  579.     }
  580.     
  581. }