src/Entity/User.php line 22

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  6. use Symfony\Component\Security\Core\User\UserInterface;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9. use Sonata\AdminBundle\Datagrid\DatagridMapper;
  10. /**
  11.  * @ORM\Entity(repositoryClass="App\Repository\UserRepository")
  12.  * @ORM\Table(name="user")
  13.  * @ORM\HasLifecycleCallbacks()
  14.  * @UniqueEntity(fields={"email"}, message="Il semblerait que vous ayez déjà un compte!")
  15.  */
  16. class User implements UserInterface
  17. {
  18.     
  19.     const STATUS_INACTIVE 0;
  20.     const STATUS_ACTIVE 1;
  21.     const STATUS_DEACTIVATED 2;
  22.     
  23.     public function __construct()
  24.     {
  25.         $this->advertisements = new ArrayCollection();
  26.         $this->reviews = new ArrayCollection();
  27.         $this->bookmarks = new ArrayCollection();
  28.         $this->helpfulReviews = new ArrayCollection();
  29.         $this->roles = [];
  30.         $this->isPublisher false;
  31.     }
  32.     public function hasBookmark(Advertisement $advertisement) {
  33.         foreach($this->getBookmarks() as $bookmark) {
  34.             if ($bookmark->getId() === $advertisement->getId()) {
  35.                 return true;
  36.             }
  37.         }
  38.         return false;
  39.     }
  40.     
  41.      public function hasHelpfulReviews(Review $review) {
  42.         foreach($this->getHelpfulReviews() as $value) {
  43.             if ($value->getId() === $review->getId()) {
  44.                 return true;
  45.             }
  46.         }
  47.         return false;
  48.     }
  49.     public function getCountActiveReviews(){
  50.         $count 0;
  51.         $active_status Review::STATUS_VALIDATE;
  52.         foreach($this->reviews as $review){
  53.             if($review->getStatus()==$active_status){
  54.                 $count ++;
  55.             }
  56.         }
  57.         return $count;
  58.     }
  59.     
  60.     public function hasBadge(){
  61.         return ($this->badge!=null);
  62.     }
  63.     
  64.     /**
  65.      * @return boolean
  66.      */
  67.     public function hasRole($role)
  68.     {
  69.         return in_array($role$this->roles);
  70.     }
  71.     /* return string rather that an object
  72.     *  @return string
  73.     */
  74.     public function __toString()
  75.     {
  76.         return sprintf('%s %s'$this->firstname$this->lastname);
  77.     }
  78.     public function getInitial(){
  79.         $fullname ''
  80.         $values explode(" ",$this->lastname);
  81.         foreach($values as $value){
  82.             $fullname .= $value[0].'.';
  83.         }
  84.         $fullname ucwords($this->firstname." ".$fullname);
  85.         return $fullname;
  86.     }
  87.     
  88.     public function getFullname(){
  89.         return ucwords($this->firstname." ".$this->lastname);
  90.     }
  91.     
  92.     
  93.     
  94.     /**
  95.      * @ORM\Id
  96.      * @ORM\GeneratedValue(strategy="AUTO")
  97.      * @ORM\Column(type="integer")
  98.      */
  99.     private $id;
  100.     /**
  101.      * @Assert\NotBlank(groups={"AdminCreate", "AdminEdit"})
  102.      * @Assert\NotNull()
  103.      * @ORM\Column(type="array")
  104.      */
  105.     private $roles;
  106.     /**
  107.      * @Assert\Regex(
  108.      *     pattern="/\d/",
  109.      *     match=false,
  110.      *     message="Un prénom ne peut pas comporter de chiffres"
  111.      * )
  112.      * @ORM\Column(type="string",nullable=true,options={"default":null})
  113.      */
  114.     private $firstname;
  115.     /**
  116.      * @Assert\Regex(
  117.      *     pattern="/\d/",
  118.      *     match=false,
  119.      *     message="Un nom ne peut pas comporter de chiffres"
  120.      * )
  121.      * @ORM\Column(type="string",nullable=true,options={"default":null})
  122.      */
  123.     private $lastname;
  124.     /**
  125.      * @ORM\Column(type="string")
  126.      */
  127.     private $username;
  128.     /**
  129.      * @Assert\NotBlank()
  130.      * @Assert\Email()
  131.      * @ORM\Column(type="string", unique=true)
  132.      */
  133.     private $email;
  134.     /**
  135.      * @Assert\Regex(
  136.      *     pattern="/^(?:0|\(?\+\d{1,3}\)?\s?)[1-9](?:[\.\-\s]?\d{2}){4}$/",
  137.      *     match=true,
  138.      *     message="Ce numéro de téléphone n'est pas valide"
  139.      * )
  140.      * @Assert\Length(
  141.      *     min = 10,
  142.      *     max = 20,
  143.      *      minMessage = "Attention un numéro de téléphone doit comporter au moins {{ limit }} chiffres",
  144.      *      maxMessage = "Attention un numéro de téléphone ne peut dépasser {{ limit }} caractères"
  145.      * )
  146.      * @ORM\Column(type="string", length=20, nullable=true)
  147.      */
  148.     private $phone;
  149.     /**
  150.      * The encoded password
  151.      *
  152.      * @ORM\Column(type="string")
  153.      */
  154.     private $password;
  155.     /**
  156.      * A non-persisted field that's used to create the encoded password.
  157.      *
  158.      * @Assert\NotBlank(groups={"Registration", "AdminCreate"})
  159.      * @Assert\Length(
  160.      *     min = 8,
  161.      *      minMessage = "Attention votre mot de passe doit comporter au moins {{ limit }} caractères",
  162.      * )
  163.      *
  164.      * @var string
  165.      */
  166.     private $plainPassword;
  167.     /**
  168.      * @ORM\ManyToOne(targetEntity="Agency", inversedBy="users", cascade={"persist"})
  169.      */
  170.     private $agency;
  171.     /**
  172.      * Random string to password reset
  173.      *
  174.      * @ORM\Column(type="string", nullable=true)
  175.      */
  176.     private $token;
  177.     /**
  178.      * @ORM\Column(type="datetime", nullable=true)
  179.      */
  180.     private $tokenValidAt;
  181.     
  182.     /**
  183.      * Random string to activate account
  184.      *
  185.      * @ORM\Column(type="string", nullable=true)
  186.      */
  187.     private $validationToken;
  188.     
  189.     /**
  190.      * @Assert\NotBlank(groups={"Subscription"})
  191.      * @ORM\ManyToOne(targetEntity="Subscription", inversedBy="user")
  192.      * @ORM\JoinColumn(name="pack_id", referencedColumnName="id")
  193.      */
  194.     private $pack;
  195.     /**
  196.      * @ORM\Column(type="integer", nullable=true)
  197.      */
  198.     private $packAdNumber;
  199.     /**
  200.      * @ORM\Column(type="datetime", nullable=true)
  201.      */
  202.     private $packDate;
  203.     /**
  204.      * @ORM\Column(type="string", nullable=true)
  205.      */
  206.     private $stripeId;
  207.     /**
  208.      * @ORM\Column(type="string", nullable=true)
  209.      */
  210.     private $stripeToken;
  211.     /**
  212.      * @ORM\OneToMany(targetEntity="Advertisement", mappedBy="user")
  213.      * @ORM\OrderBy({"createdAt" = "DESC"})
  214.      */
  215.     private $advertisements;
  216.     /**
  217.      * @ORM\OneToMany(targetEntity="Review", mappedBy="user")
  218.      * @ORM\OrderBy({"publicationDate" = "DESC"})
  219.      */
  220.     private $reviews;
  221.     /**
  222.      * @ORM\OneToMany(targetEntity="Search", mappedBy="user")
  223.      * @ORM\OrderBy({"id" = "DESC"})
  224.      */
  225.     private $searches;
  226.     /**
  227.      * @ORM\ManyToMany(targetEntity="Advertisement")
  228.      * @ORM\JoinTable(name="user_bookmarks",
  229.      *      joinColumns={@ORM\JoinColumn(name="user_id", referencedColumnName="id")},
  230.      *      inverseJoinColumns={@ORM\JoinColumn(name="advertisement_id", referencedColumnName="id",onDelete="CASCADE")}
  231.      *      )
  232.      */
  233.     private $bookmarks;
  234.     
  235.     /**
  236.      * @ORM\ManyToMany(targetEntity="Review")
  237.      * @ORM\JoinTable(name="helpful_reviews",
  238.      *      joinColumns={@ORM\JoinColumn(name="user_id", referencedColumnName="id")},
  239.      *      inverseJoinColumns={@ORM\JoinColumn(name="review_id", referencedColumnName="id",onDelete="CASCADE")}
  240.      *      )
  241.      */
  242.     private $helpfulReviews;
  243.     /**
  244.      * @ORM\Column(type="string", nullable=true)
  245.      */
  246.     private $ipAddress;
  247.     /**
  248.      * @ORM\Column(type="datetime")
  249.      */
  250.     private $createdAt;
  251.     /**
  252.      * @ORM\Column(type="datetime", nullable=true)
  253.      */
  254.     private $updatedAt;
  255.     
  256.     /**
  257.      * @ORM\Column(type="string", nullable=true)
  258.      */
  259.     private $avatarPath;
  260.     
  261.     /**
  262.      * @ORM\Column(type="integer",options={"default":1})
  263.      */
  264.     private $status;
  265.     
  266.     /**
  267.      * @ORM\OneToOne(targetEntity="UserApplication", mappedBy="user")
  268.      * @ORM\OrderBy({"id" = "DESC"})
  269.      */
  270.     private $application;
  271.     
  272.     /**
  273.      * @ORM\OneToMany(targetEntity="RentalRecord", mappedBy="user")
  274.      * @ORM\OrderBy({"createdAt" = "DESC"})
  275.      */
  276.     private $rentalRecords;
  277.     
  278.     /**
  279.      * @ORM\OneToMany(targetEntity="DiscountCoupon", mappedBy="user")
  280.      * @ORM\OrderBy({"createdAt" = "DESC"})
  281.      */
  282.     private $coupons;
  283.     /**
  284.      * @Assert\File(
  285.      *     maxSize = "2048k",
  286.      *     mimeTypes={ "application/pdf", "application/x-pdf" },
  287.      *     maxSizeMessage = "La taille de fichier maximum autorisé est : {{ limit }} {{ suffix }}.",
  288.      *     mimeTypesMessage = "Veuillez uploader le document au format pdf"
  289.      * )
  290.      * @ORM\Column(type="string", nullable=true)
  291.      */
  292.     private $leasePath;
  293.     
  294.     /**
  295.      * @ORM\OneToMany(targetEntity="Meeting", mappedBy="user")
  296.      * @ORM\OrderBy({"createdAt" = "DESC"})
  297.      */
  298.     private $meetings;
  299.     
  300.      /**
  301.      * @ORM\Column(type="datetime",nullable=true)
  302.      */
  303.     private $leaseEndingDate;
  304.     
  305.     
  306.     /**
  307.      * @ORM\Column(type="string", nullable=true)
  308.      */
  309.     private $bloggerName;
  310.     
  311.     /**
  312.      * @ORM\Column(type="string", nullable=true)
  313.      */
  314.     private $bloggerAvatarPath;
  315.     /**
  316.      * @ORM\Column(type="boolean",options={"default":true})
  317.      */
  318.     private $isPublisher;
  319.     /**
  320.      * @ORM\OneToOne(targetEntity="Badge", mappedBy="userTenant")
  321.      * @ORM\OrderBy({"id" = "DESC"})
  322.      */
  323.     private $badge;
  324.     /**
  325.      * @ORM\OneToMany(targetEntity="Badge", mappedBy="userAgency")
  326.      * @ORM\OrderBy({"id" = "DESC"})
  327.      */
  328.     private $badges;
  329.     /**
  330.      * @ORM\OneToMany(targetEntity="AgencyDocument", mappedBy="user")
  331.      * @ORM\OrderBy({"createdAt" = "DESC"})
  332.      */
  333.     private $documents;
  334.     
  335.     private $roleValue;
  336.     public function hasActiveAdvertisement()
  337.     {
  338.         foreach ($this->getAdvertisements() as $advertisement) {
  339.             if ($advertisement->getStatus() === Advertisement::STATUS_VALIDATED || $advertisement->getStatus() === Advertisement::STATUS_PUBLISHED) {
  340.                 return true;
  341.             }
  342.         }
  343.         return false;
  344.     }
  345.     
  346.     /**
  347.      * @ORM\PrePersist
  348.      * @ORM\PreUpdate
  349.      */
  350.     public function updatedTimestamps()
  351.     {
  352.         $this->setUpdatedAt(new \DateTime('now'));
  353.         if ($this->getCreatedAt() == null) {
  354.             $this->setCreatedAt(new \DateTime('now'));
  355.         }
  356.     }
  357.     /**
  358.      * @return integer
  359.      */
  360.     public function getId()
  361.     {
  362.         return $this->id;
  363.     }
  364.     /**
  365.      * @param mixed $id
  366.      */
  367.     public function setId($id)
  368.     {
  369.         $this->id $id;
  370.     }
  371.     
  372.     /**
  373.      * @param mixed $username
  374.      */
  375.     public function setUsername($username)
  376.     {
  377.         $this->username $username;
  378.     }
  379.     public function getUsername()
  380.     {
  381.         return $this->username;
  382.     }
  383.     /**
  384.      * @return array The roles
  385.      */
  386.     public function getRoles()
  387.     {
  388.         return $this->roles;
  389.     }
  390.     /**
  391.      * @param array $roles
  392.      */
  393.     public function setRoles($roles)
  394.     {
  395.         $this->roles $roles;
  396.     }
  397.     /**
  398.      * Add a role.
  399.      *
  400.      * @param string $role
  401.      *
  402.      * @return User
  403.      */
  404.     public function addRole($role)
  405.     {
  406.         $role strtoupper($role);
  407.         if (!in_array($role$this->rolestrue)) {
  408.             $this->roles[] = $role;
  409.         }
  410.         return $this;
  411.     }
  412.     /**
  413.      * Remove a role.
  414.      *
  415.      * @param string $role
  416.      *
  417.      * @return User
  418.      */
  419.     public function removeRole($role)
  420.     {
  421.         if (false !== $key array_search(strtoupper($role), $this->rolestrue)) {
  422.             unset($this->roles[$key]);
  423.             $this->roles array_values($this->roles);
  424.         }
  425.         return $this;
  426.     }
  427.     /**
  428.      * @return string
  429.      */
  430.     public function getPassword()
  431.     {
  432.         return $this->password;
  433.     }
  434.     /**
  435.      * @param string $password
  436.      */
  437.     public function setPassword($password)
  438.     {
  439.         $this->password $password;
  440.     }
  441.     /**
  442.      * @return string
  443.      */
  444.     public function getPlainPassword()
  445.     {
  446.         return $this->plainPassword;
  447.     }
  448.     /**
  449.      * @param string $plainPassword
  450.      */
  451.     public function setPlainPassword($plainPassword)
  452.     {
  453.         $this->plainPassword $plainPassword;
  454.         // Avoid Doctrine *not* saving this entity, if only plainPassword changes
  455.         $this->password null;
  456.     }
  457.     public function getSalt()
  458.     {
  459.     }
  460.     public function eraseCredentials()
  461.     {
  462.         $this->plainPassword null;
  463.     }
  464.     /**
  465.      * @return string
  466.      */
  467.     public function getFirstname()
  468.     {
  469.         return $this->firstname;
  470.     }
  471.     /**
  472.      * @param string $firstname
  473.      */
  474.     public function setFirstname($firstname)
  475.     {
  476.         $this->firstname $firstname;
  477.     }
  478.     /**
  479.      * @return string
  480.      */
  481.     public function getLastname()
  482.     {
  483.         return $this->lastname;
  484.     }
  485.     /**
  486.      * @param string $lastname
  487.      */
  488.     public function setLastname($lastname)
  489.     {
  490.         $this->lastname $lastname;
  491.     }
  492.     /**
  493.      * @return string
  494.      */
  495.     public function getEmail()
  496.     {
  497.         return $this->email;
  498.     }
  499.     /**
  500.      * @param string $email
  501.      */
  502.     public function setEmail($email)
  503.     {
  504.         $this->email $email;
  505.     }
  506.     /**
  507.      * @return string
  508.      */
  509.     public function getPhone()
  510.     {
  511.         return $this->phone;
  512.     }
  513.     /**
  514.      * @param string $phone
  515.      */
  516.     public function setPhone($phone)
  517.     {
  518.         $this->phone $phone;
  519.     }
  520.     /**
  521.      * @return Agency|null
  522.      */
  523.     public function getAgency()
  524.     {
  525.         return $this->agency;
  526.     }
  527.     /**
  528.      * @param Subscription $pack
  529.      *
  530.      * @return User
  531.      */
  532.     public function setPack(Subscription $pack)
  533.     {
  534.         $this->pack $pack;
  535.         return $this;
  536.     }
  537.     /**
  538.      * @return Subscription
  539.      */
  540.     public function getPack()
  541.     {
  542.         return $this->pack;
  543.     }
  544.     /**
  545.      * @return integer
  546.      */
  547.     public function getPackAdNumber()
  548.     {
  549.         return $this->packAdNumber;
  550.     }
  551.     /**
  552.      * @param integer $packAdNumber
  553.      */
  554.     public function setPackAdNumber($packAdNumber)
  555.     {
  556.         $this->packAdNumber $packAdNumber;
  557.     }
  558.     /**
  559.      * @ORM\PrePersist
  560.      */
  561.     public function setPackDate()
  562.     {
  563.         $this->packDate = new \DateTime();
  564.     }
  565.     /**
  566.      * @return \DateTime
  567.      */
  568.     public function getPackDate()
  569.     {
  570.         return $this->packDate;
  571.     }
  572.     /**
  573.      * @return string
  574.      */
  575.     public function getStripeId()
  576.     {
  577.         return $this->stripeId;
  578.     }
  579.     /**
  580.      * @param string $stripeId
  581.      */
  582.     public function setStripeId($stripeId)
  583.     {
  584.         $this->stripeId $stripeId;
  585.     }
  586.     /**
  587.      * @return string
  588.      */
  589.     public function getStripeToken()
  590.     {
  591.         return $this->stripeToken;
  592.     }
  593.     /**
  594.      * @param string $stripeToken
  595.      */
  596.     public function setStripeToken($stripeToken)
  597.     {
  598.         $this->stripeToken $stripeToken;
  599.     }
  600.     /**
  601.      * @return Collection
  602.      */
  603.     public function getAdvertisements()
  604.     {
  605.         return $this->advertisements;
  606.     }
  607.     /**
  608.      * @param Advertisement $bookmarks
  609.      */
  610.     public function addBookmarks($bookmarks)
  611.     {
  612.         $this->bookmarks[] = $bookmarks;
  613.     }
  614.     /**
  615.      * @param Advertisement $bookmarks
  616.      */
  617.     public function removeBookmarks(Advertisement $bookmarks)
  618.     {
  619.         $this->bookmarks->removeElement($bookmarks);
  620.     }
  621.     
  622.     /**
  623.      * @return Collection
  624.      */
  625.     public function getBookmarks()
  626.     {
  627.         return $this->bookmarks;
  628.     }
  629.     
  630.     /**
  631.      * @return Collection
  632.      */
  633.     public function getHelpfulReviews()
  634.     {
  635.         return $this->helpfulReviews;
  636.     }
  637.     
  638.     
  639.     /**
  640.      * @param Review $helpfulReviews
  641.      */
  642.     public function addHelpfulReviews($helpfulReviews)
  643.     {
  644.         $this->helpfulReviews[] = $helpfulReviews;
  645.     }
  646.     /**
  647.      * @param Review $helpfulReviews
  648.      */
  649.     public function setHelpfulReviews(Review $helpfulReviews)
  650.     {
  651.         $this->helpfulReviews->removeElement($helpfulReviews);
  652.     }
  653.      /**
  654.      * @param Review $helpfulReviews
  655.      */
  656.     public function removeHelpfulReviews(Review $helpfulReviews)
  657.     {
  658.         $this->helpfulReviews->removeElement($helpfulReviews);
  659.     }
  660.    
  661.     
  662.     /**
  663.      * @return string
  664.      */
  665.     public function getIpAddress()
  666.     {
  667.         return $this->ipAddress;
  668.     }
  669.     /**
  670.      * @param string $ipAddress
  671.      */
  672.     public function setIpAddress($ipAddress)
  673.     {
  674.         $this->ipAddress $ipAddress;
  675.     }
  676.     /**
  677.      * @return string
  678.      */
  679.     public function getToken()
  680.     {
  681.         return $this->token;
  682.     }
  683.     /**
  684.      * @param string $token
  685.      */
  686.     public function setToken($token)
  687.     {
  688.         $this->token $token;
  689.     }
  690.     /**
  691.      * @param \DateTime $tokenValidAt
  692.      */
  693.     public function setTokenValidAt($tokenValidAt)
  694.     {
  695.         $this->tokenValidAt $tokenValidAt;
  696.     }
  697.     /**
  698.      * @return \DateTime
  699.      */
  700.     public function getTokenValidAt()
  701.     {
  702.         return $this->tokenValidAt;
  703.     }
  704.     /**
  705.      * @return string
  706.      */
  707.     public function getValidationToken()
  708.     {
  709.         return $this->validationToken;
  710.     }
  711.     /**
  712.      * @param string $validationToken
  713.      */
  714.     public function setValidationToken($validationToken)
  715.     {
  716.         $this->validationToken $validationToken;
  717.     }
  718.     
  719.     
  720.     /**
  721.      * @return mixed
  722.      */
  723.     public function getSearches()
  724.     {
  725.         return $this->searches;
  726.     }
  727.     /**
  728.      * @param mixed $searches
  729.      */
  730.     public function setSearches($searches)
  731.     {
  732.         $this->searches $searches;
  733.     }
  734.     /**
  735.      * @return \DateTime|null
  736.      */
  737.     public function getUpdatedAt()
  738.     {
  739.         return $this->updatedAt;
  740.     }
  741.     /**
  742.      * @param \DateTime $updatedAt
  743.      */
  744.     public function setUpdatedAt($updatedAt)
  745.     {
  746.         $this->updatedAt $updatedAt;
  747.     }
  748.     /**
  749.      * @return \DateTime
  750.      */
  751.     public function getCreatedAt()
  752.     {
  753.         return $this->createdAt;
  754.     }
  755.     /**
  756.      * @param \DateTime $createdAt
  757.      */
  758.     public function setCreatedAt($createdAt)
  759.     {
  760.         $this->createdAt $createdAt;
  761.     }
  762.     /**
  763.      * Set agency
  764.      *
  765.      * @param \App\Entity\Agency $agency
  766.      *
  767.      * @return User
  768.      */
  769.     public function setAgency(\App\Entity\Agency $agency null)
  770.     {
  771.         $this->agency $agency;
  772.         return $this;
  773.     }
  774.     /**
  775.      * Add advertisement
  776.      *
  777.      * @param \App\Entity\Advertisement $advertisement
  778.      *
  779.      * @return User
  780.      */
  781.     public function addAdvertisement(\App\Entity\Advertisement $advertisement)
  782.     {
  783.         $this->advertisements[] = $advertisement;
  784.         return $this;
  785.     }
  786.     /**
  787.      * Remove advertisement
  788.      *
  789.      * @param \App\Entity\Advertisement $advertisement
  790.      */
  791.     public function removeAdvertisement(\App\Entity\Advertisement $advertisement)
  792.     {
  793.         $this->advertisements->removeElement($advertisement);
  794.     }
  795.     /**
  796.      * @return mixed
  797.      */
  798.     public function getReviews()
  799.     {
  800.         return $this->reviews;
  801.     }
  802.     /**
  803.      * @param mixed $reviews
  804.      */
  805.     public function setReviews($reviews)
  806.     {
  807.         $this->reviews $reviews;
  808.     }
  809.     /**
  810.      * Add search
  811.      *
  812.      * @param \App\Entity\Search $search
  813.      *
  814.      * @return User
  815.      */
  816.     public function addSearch(\App\Entity\Search $search)
  817.     {
  818.         $this->searches[] = $search;
  819.         return $this;
  820.     }
  821.     /**
  822.      * Remove search
  823.      *
  824.      * @param \App\Entity\Search $search
  825.      */
  826.     public function removeSearch(\App\Entity\Search $search)
  827.     {
  828.         $this->searches->removeElement($search);
  829.     }
  830.     /**
  831.      * Add bookmark
  832.      *
  833.      * @param \App\Entity\Advertisement $bookmark
  834.      *
  835.      * @return User
  836.      */
  837.     public function addBookmark(\App\Entity\Advertisement $bookmark)
  838.     {
  839.         $this->bookmarks[] = $bookmark;
  840.         return $this;
  841.     }
  842.     /**
  843.      * Remove bookmark
  844.      *
  845.      * @param \App\Entity\Advertisement $bookmark
  846.      */
  847.     public function removeBookmark(\App\Entity\Advertisement $bookmark)
  848.     {
  849.         $this->bookmarks->removeElement($bookmark);
  850.     }
  851.     
  852.     /**
  853.      * @return mixed
  854.      */
  855.     public function getRoleValue()
  856.     {
  857.         return $this->roleValue;
  858.     }
  859.     /**
  860.      * @param mixed $roleValue
  861.      */
  862.     public function setRoleValue($roleValue)
  863.     {
  864.         $this->roleValue $roleValue;
  865.     }
  866.     
  867.     /**
  868.      * @return mixed
  869.      */
  870.     public function getAvatarPath()
  871.     {
  872.         return $this->avatarPath;
  873.     }
  874.     /**
  875.      * @param mixed $avatar
  876.      */
  877.     public function setAvatarPath($avatar)
  878.     {
  879.         $this->avatarPath $avatar;
  880.     }
  881.     
  882.     /**
  883.      * @return mixed
  884.      */
  885.     public function getStatus()
  886.     {
  887.         return $this->status;
  888.     }
  889.     /**
  890.      * @param mixed $status
  891.      */
  892.     public function setStatus($status)
  893.     {
  894.         $this->status $status;
  895.     }
  896.     
  897.     /**
  898.      * @return mixed
  899.      */
  900.     public function getApplication()
  901.     {
  902.         return $this->application;
  903.     }
  904.    
  905.     /**
  906.      * @param mixed $application
  907.      */
  908.     public function setApplication($application)
  909.     {
  910.         $this->application $application;
  911.     }
  912.     
  913.      /**
  914.      * @param mixed $rentalRecords
  915.      */
  916.     public function setRentalRecords($rentalRecords)
  917.     {
  918.         $this->rentalRecords $rentalRecords;
  919.     }
  920.     
  921.     /**
  922.      * @return mixed
  923.      */
  924.     public function getRentalRecords()
  925.     {
  926.         return $this->rentalRecords;
  927.     }
  928.     
  929.      /**
  930.      * @param mixed $coupons
  931.      */
  932.     public function setCoupons($coupons)
  933.     {
  934.         $this->coupons $coupons;
  935.     }
  936.     
  937.     /**
  938.      * @return mixed
  939.      */
  940.     public function getCoupons()
  941.     {
  942.         return $this->coupons;
  943.     }
  944.     
  945.     
  946.     public function addCoupons(DiscountCoupon $coupon){
  947.         $this->coupons[] = $coupon;
  948.         return $this;
  949.     }
  950.     
  951.     
  952.     public function removeCoupons(DiscountCoupon $coupon)
  953.     {
  954.         $this->coupons->removeElement($coupon);
  955.     }
  956.     
  957.     
  958.     /**
  959.      * @return mixed
  960.      */
  961.     public function getLeasePath()
  962.     {
  963.         return $this->leasePath;
  964.     }
  965.     /**
  966.      * @param mixed $leasePath
  967.      */
  968.     public function setLeasePath($leasePath)
  969.     {
  970.         $this->leasePath $leasePath;
  971.     }
  972.     
  973.     /**
  974.      * @return \DateTime
  975.      */
  976.     public function getLeaseEndingDate()
  977.     {
  978.         return $this->leaseEndingDate;
  979.     }
  980.     /**
  981.      * @param \DateTime $leaseEndingDate
  982.      */
  983.     public function setLeaseEndingDate($leaseEndingDate)
  984.     {
  985.         $this->leaseEndingDate $leaseEndingDate;
  986.     }
  987.     
  988.      /**
  989.      * @param mixed $coupons
  990.      */
  991.     public function setMeetings($meetings)
  992.     {
  993.         $this->meetings $meetings;
  994.     }
  995.     
  996.     /**
  997.      * @return mixed
  998.      */
  999.     public function getMeetings()
  1000.     {
  1001.         return $this->meetings;
  1002.     }
  1003.     
  1004.     
  1005.     /**
  1006.      * @return mixed
  1007.      */
  1008.     public function getBloggerName()
  1009.     {
  1010.         return $this->bloggerName;
  1011.     }
  1012.     /**
  1013.      * @param mixed $avatar
  1014.      */
  1015.     public function setBloggerName($bloggerName)
  1016.     {
  1017.         $this->bloggerName $bloggerName;
  1018.     }
  1019.     
  1020.     /**
  1021.      * @return mixed
  1022.      */
  1023.     public function getBloggerAvatarPath()
  1024.     {
  1025.         return $this->bloggerAvatarPath;
  1026.     }
  1027.     /**
  1028.      * @param mixed $avatar
  1029.      */
  1030.     public function setBloggerAvatarPath($bloggerAvatarPath)
  1031.     {
  1032.         $this->bloggerAvatarPath $bloggerAvatarPath;
  1033.     }
  1034.     /**
  1035.      * @return mixed
  1036.      */
  1037.     public function getIsPublisher()
  1038.     {
  1039.         return $this->isPublisher;
  1040.     }
  1041.     /**
  1042.      * @return mixed
  1043.      */
  1044.     public function isPublisher()
  1045.     {
  1046.         return $this->isPublisher;
  1047.     }
  1048.     /**
  1049.      * @param mixed $isPublisher
  1050.      */
  1051.     public function setIsPublisher($isPublisher)
  1052.     {
  1053.         $this->isPublisher $isPublisher;
  1054.     }
  1055.     /**
  1056.      * @return mixed
  1057.      */
  1058.     public function getBadge()
  1059.     {
  1060.         return $this->badge;
  1061.     }
  1062.     /**
  1063.      * @param mixed $badge
  1064.      */
  1065.     public function setBadge($badge)
  1066.     {
  1067.         $this->badge $badge;
  1068.     }
  1069.     /**
  1070.      * @return mixed
  1071.      */
  1072.     public function getBadges()
  1073.     {
  1074.         return $this->badges;
  1075.     }
  1076.     /**
  1077.      * @param mixed $badges
  1078.      */
  1079.     public function setBadges($badges)
  1080.     {
  1081.         $this->badges $badges;
  1082.     }
  1083.     /**
  1084.      * @return mixed
  1085.      */
  1086.     public function getDocuments()
  1087.     {
  1088.         return $this->documents;
  1089.     }
  1090.     /**
  1091.      * @param mixed $documents
  1092.      */
  1093.     public function setDocuments($documents)
  1094.     {
  1095.         $this->documents $documents;
  1096.     }
  1097.     /**
  1098.      * @return mixed
  1099.      */
  1100.     public function getDocument()
  1101.     {
  1102.         return $this->document;
  1103.     }
  1104.     /**
  1105.      * @param mixed $document
  1106.      */
  1107.     public function setDocument($document)
  1108.     {
  1109.         $this->document $document;
  1110.     }
  1111.     /**
  1112.      * Add document
  1113.      *
  1114.      * @param \App\Entity\AgencyDocument $document
  1115.      *
  1116.      * @return Agency
  1117.      */
  1118.     public function addDocument(\App\Entity\AgencyDocument $document)
  1119.     {
  1120.         $this->documents[] = $document;
  1121.         return $this;
  1122.     }
  1123.     
  1124.     
  1125. }