Advertisement
Guest User

Untitled

a guest
Apr 7th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.57 KB | None | 0 0
  1. <?php
  2.  
  3. namespace Labco\CoreBundle\Entity;
  4.  
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Util\Debug;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Labco\CoreBundle\Entity\User\LocalCode;
  9. use Labco\CoreBundle\Entity\User\SamplingDeposit;
  10. use Labco\CoreBundle\Entity\User\Speciality;
  11. use Labco\CoreBundle\Entity\User\Status;
  12. use Symfony\Component\Security\Core\User\UserInterface;
  13. use Labco\CoreBundle\Entity\Relations\UserSel;
  14. use Labco\CoreBundle\Entity\User\Circuit;
  15. use Symfony\Component\Validator\Constraints as Assert;
  16. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  17. use JMS\Serializer\Annotation\Groups;
  18. use Symfony\Component\Validator\Context\ExecutionContextInterface;
  19. use JMS\Serializer\Annotation as JMS;
  20.  
  21. /**
  22. * User
  23. *
  24. * @ORM\Table(indexes={@ORM\Index(name="date_updated_idx", columns={"date_updated"})})
  25. * @ORM\Entity(repositoryClass="Labco\CoreBundle\Repository\UserRepository")
  26. * @UniqueEntity("email",message="user.profil_exist", repositoryMethod="labcoFindEmail")
  27. */
  28. class User extends Historisation implements UserInterface {
  29.  
  30. const ROOT_EMAIL_ADDRESS = "admin@root.com";
  31. /**
  32. * @var integer
  33. * @Groups({"listUser", "detailsUser","detailsClusAck"})
  34. * @ORM\Column(name="id", type="integer")
  35. * @ORM\Id
  36. * @ORM\GeneratedValue(strategy="AUTO")
  37. */
  38. protected $id;
  39.  
  40. /**
  41. * @var string
  42. *
  43. * @Groups({"listUser", "detailsUser"})
  44. * @ORM\Column(name="email", type="string", length=255)
  45. * @Assert\NotBlank()
  46. * @Assert\Email()
  47. */
  48. protected $email;
  49.  
  50. /**
  51. * @var boolean
  52. *
  53. * @Groups({"detailsUser"})
  54. * @ORM\Column(name="enabled", type="boolean")
  55. */
  56. protected $enabled;
  57.  
  58. /**
  59. * @var string
  60. *
  61. * @Groups({"detailsUser"})
  62. * @ORM\Column(name="salt", type="string", length=255)
  63. */
  64. protected $salt;
  65.  
  66. /**
  67. * @var string
  68. *
  69. * @Groups({"detailsUser"})
  70. * @ORM\Column(name="password", type="string", length=255)
  71. */
  72. protected $password;
  73.  
  74. /**
  75. * @var array
  76. *
  77. * @ORM\Column(name="roles", type="array")
  78. * @Groups({"none"})
  79. */
  80. protected $roles;
  81.  
  82. /**
  83. * @var string
  84. *
  85. * @Groups({"detailsUser"})
  86. * @ORM\Column(name="firstname", type="string", length=255)
  87. * @Assert\NotBlank()
  88. */
  89. protected $firstname;
  90.  
  91. /**
  92. * @var string
  93. *
  94. * @Groups({"detailsUser"})
  95. * @ORM\Column(name="lastname", type="string", length=255)
  96. * @Assert\NotBlank()
  97. */
  98. protected $lastname;
  99.  
  100. /**
  101. * @ORM\OneToMany(targetEntity="Labco\CoreBundle\Entity\Relations\UserSel", mappedBy="user")
  102. */
  103. protected $userSels;
  104.  
  105. /**
  106. * @Groups({"detailsUser"})
  107. *
  108. * @ORM\ManyToOne(targetEntity="Labco\CoreBundle\Entity\Lang")
  109. * @ORM\JoinColumn(nullable=false)
  110. */
  111. protected $lang;
  112.  
  113. /**
  114. * @var $status Status
  115. *
  116. * @ORM\ManyToOne(targetEntity="Labco\CoreBundle\Entity\User\Status")
  117. * @ORM\JoinColumn(nullable=false)
  118. */
  119. protected $status;
  120.  
  121. /**
  122. * @var $speciality Speciality
  123. *
  124. * @ORM\ManyToOne(targetEntity="Labco\CoreBundle\Entity\User\Speciality")
  125. * @ORM\JoinColumn(nullable=true)
  126. */
  127. protected $speciality;
  128.  
  129. /**
  130. * @var string
  131. *
  132. * @ORM\Column(name="adeli", type="string", length=10, nullable = true)
  133. */
  134. protected $adeli;
  135.  
  136. /**
  137. * @ORM\OneToMany(targetEntity="Labco\CoreBundle\Entity\Analysis\AckAnalysis", mappedBy="user")
  138. */
  139. private $ackNotifications;
  140.  
  141. /**
  142. * @var $circuits ArrayCollection
  143. *
  144. * @ORM\OneToMany(targetEntity="Labco\CoreBundle\Entity\User\Circuit", mappedBy="user")
  145. */
  146. protected $circuits;
  147.  
  148. /**
  149. * @var $samplingDeposits ArrayCollection
  150. *
  151. * @ORM\OneToMany(targetEntity="Labco\CoreBundle\Entity\User\SamplingDeposit", mappedBy="user")
  152. */
  153. protected $samplingDeposits;
  154.  
  155. /**
  156. * @var $clusUserVersions ArrayCollection
  157. * @ORM\OneToMany(targetEntity="Labco\CoreBundle\Entity\ClusAck", mappedBy="user")
  158. */
  159. protected $clusAcks;
  160.  
  161. /**
  162. * @var $localCodes ArrayCollection
  163. * @ORM\OneToMany(targetEntity="Labco\CoreBundle\Entity\User\LocalCode", mappedBy="user")
  164. */
  165. protected $localCodes;
  166.  
  167. /**
  168. * @ORM\OneToMany(targetEntity="Labco\CoreBundle\Entity\Relations\UserPatient", mappedBy="user")
  169. */
  170. protected $userPatients;
  171.  
  172. /**
  173. * @ORM\ManyToOne(targetEntity="Labco\CoreBundle\Entity\Sel")
  174. * @ORM\JoinColumn(name="default_sel_id", nullable=true)
  175. */
  176. protected $defaultSel;
  177.  
  178.  
  179. public function __construct()
  180. {
  181. parent::__construct();
  182.  
  183. $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
  184. $randomString = '';
  185. for ($i = 0; $i < 60; $i++) {
  186. $randomString .= $characters[rand(0, strlen($characters) - 1)];
  187. }
  188.  
  189. $this->enabled = true;
  190. $this->salt = base_convert(sha1(uniqid(mt_rand(), true)), 16, 36);
  191. $this->password = $randomString;
  192. $this->roles = array('ROLE_USER');
  193. $this->sels = new ArrayCollection();
  194. $this->ackNotifications = new ArrayCollection;
  195. $this->circuits = new ArrayCollection();
  196. $this->samplingDeposits = new ArrayCollection();
  197. $this->clusAcks = new ArrayCollection();
  198. $this->localCodes = new ArrayCollection();
  199. $this->patients = new ArrayCollection();
  200. $this->userPatients = new ArrayCollection();
  201.  
  202. }
  203.  
  204. public function clearAllCollections()
  205. {
  206.  
  207. $this->circuits = new ArrayCollection();
  208. $this->samplingDeposits = new ArrayCollection();
  209. $this->clusAcks = new ArrayCollection();
  210. $this->localCodes = new ArrayCollection();
  211. $this->userPatients = new ArrayCollection();
  212.  
  213. }
  214.  
  215.  
  216. /**
  217. * @Assert\Callback
  218. */
  219. public function validate(ExecutionContextInterface $context)
  220. {
  221. if ($this->getStatus()->getHasAdeliNumber() && empty($this->adeli)) {
  222.  
  223. $context->buildViolation("form.user.error_adeli")->setTranslationDomain("messages")->atPath("adeli")->addViolation();
  224. }
  225.  
  226. if ($this->getStatus()->getHasSpeciality() && $this->getSpeciality()->getCode() == "unspecified") {
  227. $context->buildViolation('form.user.error_speciality')->setTranslationDomain("messages")->atPath("speciality")->addViolation();
  228. }
  229. }
  230.  
  231. /**
  232. * Get id
  233. *
  234. * @return integer
  235. */
  236. public function getId()
  237. {
  238. return $this->id;
  239. }
  240.  
  241. /**
  242. * Set email
  243. *
  244. * @param string $email
  245. * @return User
  246. */
  247. public function setEmail($email)
  248. {
  249. $this->email = $email;
  250.  
  251. return $this;
  252. }
  253.  
  254. /**
  255. * Get email
  256. *
  257. * @return string
  258. */
  259. public function getEmail()
  260. {
  261. return $this->email;
  262. }
  263.  
  264. /**
  265. * Set enabled
  266. *
  267. * @param boolean $enabled
  268. * @return User
  269. */
  270. public function setEnabled($enabled)
  271. {
  272. $this->enabled = $enabled;
  273.  
  274. return $this;
  275. }
  276.  
  277. /**
  278. * Get enabled
  279. *
  280. * @return boolean
  281. */
  282. public function getEnabled()
  283. {
  284. return $this->enabled;
  285. }
  286.  
  287. /**
  288. * Set salt
  289. *
  290. * @param string $salt
  291. * @return User
  292. */
  293. public function setSalt($salt)
  294. {
  295. $this->salt = $salt;
  296.  
  297. return $this;
  298. }
  299.  
  300. /**
  301. * Get salt
  302. *
  303. * @return string
  304. */
  305. public function getSalt()
  306. {
  307. return $this->salt;
  308. }
  309.  
  310. /**
  311. * Set password
  312. *
  313. * @param string $password
  314. * @return User
  315. */
  316. public function setPassword($password)
  317. {
  318. $this->password = $password;
  319.  
  320. return $this;
  321. }
  322.  
  323. /**
  324. * Get password
  325. *
  326. * @return string
  327. */
  328. public function getPassword()
  329. {
  330. return $this->password;
  331. }
  332.  
  333. /**
  334. * Set roles
  335. *
  336. * @param array $roles
  337. * @return User
  338. */
  339. public function setRoles($roles)
  340. {
  341. $this->roles = $roles;
  342.  
  343. return $this;
  344. }
  345.  
  346. public function addRole($role)
  347. {
  348. $role = strtoupper($role);
  349. if ($role === 'ROLE_USER') {
  350. return $this;
  351. }
  352.  
  353. if (!in_array($role, $this->roles, true)) {
  354. $this->roles[] = $role;
  355. }
  356.  
  357. return $this;
  358. }
  359.  
  360. public function removeRole($role)
  361. {
  362. if (false !== $key = array_search(strtoupper($role), $this->roles, true)) {
  363. unset($this->roles[$key]);
  364. $this->roles = array_values($this->roles);
  365. }
  366.  
  367. return $this;
  368. }
  369.  
  370. /**
  371. * Get roles
  372. *
  373. * @return array
  374. */
  375. public function getRoles()
  376. {
  377. return $this->roles;
  378. }
  379.  
  380. /**
  381. * Set firstname
  382. *
  383. * @param string $firstname
  384. * @return User
  385. */
  386. public function setFirstname($firstname)
  387. {
  388. $this->firstname = $firstname;
  389.  
  390. return $this;
  391. }
  392.  
  393. /**
  394. * Get firstname
  395. *
  396. * @return string
  397. */
  398. public function getFirstname()
  399. {
  400. return $this->firstname;
  401. }
  402.  
  403. /**
  404. * Set lastname
  405. *
  406. * @param string $lastname
  407. * @return User
  408. */
  409. public function setLastname($lastname)
  410. {
  411. $this->lastname = $lastname;
  412.  
  413. return $this;
  414. }
  415.  
  416. /**
  417. * Get lastname
  418. *
  419. * @return string
  420. */
  421. public function getLastname()
  422. {
  423. return $this->lastname;
  424. }
  425.  
  426. /**
  427. * Returns the username used to authenticate the user.
  428. *
  429. * @return string The username
  430. */
  431. public function getUsername()
  432. {
  433. return $this->email;
  434. }
  435.  
  436. /**
  437. * @param mixed $lang
  438. */
  439. public function setLang($lang)
  440. {
  441. $this->lang = $lang;
  442. }
  443.  
  444. /**
  445. * @return mixed
  446. */
  447. public function getLang()
  448. {
  449. return $this->lang;
  450. }
  451.  
  452. /**
  453. * @param string $adeli
  454. */
  455. public function setAdeli($adeli)
  456. {
  457. $this->adeli = $adeli;
  458. }
  459.  
  460. /**
  461. * @return string
  462. */
  463. public function getAdeli()
  464. {
  465. return $this->adeli;
  466. }
  467.  
  468. /**
  469. * Removes sensitive data from the user.
  470. *
  471. * This is important if, at any given point, sensitive information like
  472. * the plain-text password is stored on this object.
  473. */
  474. public function eraseCredentials()
  475. {
  476. }
  477.  
  478. /**
  479. * @param \Labco\CoreBundle\Entity\User\Speciality $speciality
  480. */
  481. public function setSpeciality($speciality)
  482. {
  483. $this->speciality = $speciality;
  484. }
  485.  
  486. /**
  487. * @return \Labco\CoreBundle\Entity\User\Speciality
  488. */
  489. public function getSpeciality()
  490. {
  491. return $this->speciality;
  492. }
  493.  
  494. /**
  495. * @param Status $status
  496. */
  497. public function setStatus($status)
  498. {
  499. $this->status = $status;
  500. }
  501.  
  502. /**
  503. * @return Status
  504. */
  505. public function getStatus()
  506. {
  507. return $this->status;
  508. }
  509.  
  510. /**
  511. * @param mixed $userSels
  512. */
  513. public function setUserSels($userSels)
  514. {
  515. $this->userSels = $userSels;
  516. }
  517.  
  518. /**
  519. * Add userSels
  520. *
  521. * @param \Labco\CoreBundle\Entity\Relations\UserSel $userSels
  522. * @return User
  523. */
  524. public function addUserSel(\Labco\CoreBundle\Entity\Relations\UserSel $userSels)
  525. {
  526. $this->userSels[] = $userSels;
  527.  
  528. return $this;
  529. }
  530.  
  531. /**
  532. * Remove userSels
  533. *
  534. * @param \Labco\CoreBundle\Entity\Relations\UserSel $userSels
  535. */
  536. public function removeUserSel(\Labco\CoreBundle\Entity\Relations\UserSel $userSels)
  537. {
  538. $this->userSels->removeElement($userSels);
  539. }
  540.  
  541. /**
  542. * Get userSels
  543. *
  544. * @return \Doctrine\Common\Collections\Collection
  545. */
  546. public function getUserSels()
  547. {
  548. $userSels = $this->filterWithHistorisation($this->userSels);
  549.  
  550. return $userSels;
  551. }
  552.  
  553.  
  554. /**
  555. * @param mixed $ackNotifications
  556. */
  557. public function setAckNotifications($ackNotifications)
  558. {
  559. $this->ackNotifications = $ackNotifications;
  560. }
  561.  
  562. /**
  563. * Add ackNotifications
  564. *
  565. * @param \Labco\CoreBundle\Entity\Analysis\AckAnalysis $ackNotifications
  566. * @return User
  567. */
  568. public function addAckNotifications(\Labco\CoreBundle\Entity\Analysis\AckAnalysis $ackNotifications)
  569. {
  570. $this->ackNotifications[] = $ackNotifications;
  571.  
  572. return $this;
  573. }
  574.  
  575. /**
  576. * Remove ackNotifications
  577. *
  578. * @param \Labco\CoreBundle\Entity\Analysis\AckAnalysis $ackNotifications
  579. */
  580. public function removeAckNotifications(\Labco\CoreBundle\Entity\Analysis\AckAnalysis $ackNotifications)
  581. {
  582. $this->ackNotifications->removeElement($ackNotifications);
  583. }
  584.  
  585. /**
  586. * Get ackNotifications
  587. *
  588. * @return \Doctrine\Common\Collections\Collection
  589. */
  590. public function getAckNotifications()
  591. {
  592. return $this->ackNotifications;
  593. }
  594.  
  595. /**
  596. * @param mixed $conservations
  597. */
  598. public function setConservations($conservations)
  599. {
  600. $this->conservations = $conservations;
  601. }
  602.  
  603. /**
  604. * @return mixed
  605. */
  606. public function getCircuits()
  607. {
  608. $this->circuits = $this->filterWithHistorisation($this->circuits);
  609.  
  610. return $this->circuits;
  611. }
  612.  
  613. /**
  614. * @param mixed $circuits
  615. */
  616. public function setCircuits($circuits)
  617. {
  618. $this->circuits = $circuits;
  619. }
  620.  
  621. public function removeCircuit(Circuit $circuit)
  622. {
  623. $this->circuits->removeElement($circuit);
  624. }
  625.  
  626. /**
  627. * @return mixed
  628. */
  629. public function getSamplingDeposits()
  630. {
  631. $this->samplingDeposits = $this->filterWithHistorisation($this->samplingDeposits);
  632.  
  633. return $this->samplingDeposits;
  634. }
  635.  
  636. /**
  637. * @param mixed $samplingDeposits
  638. */
  639. public function setSamplingDeposits($samplingDeposits)
  640. {
  641. $this->samplingDeposits = $samplingDeposits;
  642. }
  643.  
  644. public function removeSamplingDeposit(SamplingDeposit $samplingDeposit)
  645. {
  646. $this->samplingDeposits->removeElement($samplingDeposit);
  647. }
  648.  
  649. /**
  650. * @return ArrayCollection
  651. */
  652. public function getClusAcks()
  653. {
  654. $this->clusAcks = $this->filterWithHistorisation($this->clusAcks);
  655.  
  656. return $this->clusAcks;
  657. }
  658.  
  659.  
  660. public function addClusAck(ClusAck $clusAck)
  661. {
  662. $this->clusAcks[] = $clusAck;
  663.  
  664. return $this;
  665. }
  666.  
  667. public function removeClusAck(ClusAck $clusAck)
  668. {
  669. $this->clusAcks->removeElement($clusAck);
  670. }
  671.  
  672. /**
  673. * @return ArrayCollection
  674. */
  675. public function getLocalCodes()
  676. {
  677. $this->localCodes = $this->filterWithHistorisation($this->localCodes);
  678. return $this->localCodes;
  679. }
  680.  
  681.  
  682. public function addLocalCode(LocalCode $localCode)
  683. {
  684. $this->localCodes[] = $localCode;
  685.  
  686. return $this;
  687. }
  688.  
  689. public function removeLocalCode(LocalCode $localCode)
  690. {
  691. $this->localCodes->removeElement($localCode);
  692. }
  693.  
  694. /**
  695. * @param mixed $localCodes
  696. */
  697. public function setLocalCodes($localCodes)
  698. {
  699. $this->localCodes = $localCodes;
  700. }
  701.  
  702. /**
  703. * @param mixed $userPatients
  704. */
  705. public function setUserPatients($userPatients)
  706. {
  707. $this->userPatients = $userPatients;
  708. }
  709.  
  710. /**
  711. * Add userPatients
  712. *
  713. * @param \Labco\CoreBundle\Entity\Relations\UserPatient $userPatients
  714. * @return Patient
  715. */
  716. public function addUserPatient(\Labco\CoreBundle\Entity\Relations\UserPatient $userPatients)
  717. {
  718. $this->userPatients[] = $userPatients;
  719.  
  720. return $this;
  721. }
  722.  
  723. /**
  724. * Remove userPatients
  725. *
  726. * @param \Labco\CoreBundle\Entity\Relations\UserPatient $userPatients
  727. */
  728. public function removeUserPatient(\Labco\CoreBundle\Entity\Relations\UserPatient $userPatients)
  729. {
  730. $this->userPatients->removeElement($userPatients);
  731. }
  732.  
  733. /**
  734. * Get userPatients
  735. *
  736. * @return \Doctrine\Common\Collections\Collection
  737. */
  738. public function getUserPatients()
  739. {
  740. $this->userPatients = $this->filterWithHistorisation($this->userPatients);
  741.  
  742. return $this->userPatients;
  743. }
  744.  
  745. /**
  746. * @return mixed
  747. */
  748. public function getDefaultSel()
  749. {
  750. return $this->defaultSel;
  751. }
  752.  
  753. /**
  754. * @param mixed $defaultSel
  755. * @return User
  756. */
  757. public function setDefaultSel($defaultSel)
  758. {
  759. $this->defaultSel = $defaultSel;
  760.  
  761. return $this;
  762. }
  763.  
  764.  
  765. //API
  766. /**
  767. * @JMS\VirtualProperty
  768. * @JMS\SerializedName("isNurse")
  769. * @JMS\Groups({"detailsUser"})
  770. * @return boolean
  771. */
  772. public function isNurse()
  773. {
  774. if ($this->getStatus() == null) {
  775. return false;
  776. }
  777.  
  778. return $this->getStatus()->getIsNurse();
  779. }
  780.  
  781. /**
  782. * @JMS\VirtualProperty
  783. * @JMS\SerializedName("user_sels")
  784. * @JMS\Groups({"detailsUser"})
  785. *
  786. * @return String
  787. */
  788. public function getApiUserSels()
  789. {
  790. $userSels = $this->filterWithHistorisation($this->userSels);
  791.  
  792. return $userSels;
  793. }
  794.  
  795. /**
  796. * @JMS\VirtualProperty
  797. * @JMS\SerializedName("clus_acks")
  798. * @JMS\Groups({"userClusAck"})
  799. * @return ArrayCollection
  800. */
  801. public function getApiClusAcks()
  802. {
  803. $clusAcks = null;
  804. if (!$this->isGlobal()) {
  805. $clusAcks = $this->filterWithHistorisationClusAcks($this->clusAcks);
  806. }
  807.  
  808. return $clusAcks;
  809. }
  810. public function filterWithHistorisationClusAcks($collection){
  811. $entities = new ArrayCollection();
  812. if(!is_object($collection) || $collection->isEmpty()) {
  813. return $entities;
  814. }
  815. foreach($collection as $entity){
  816. if( $entity->getDateOut() > new \DateTime() &&
  817. $entity->getDateDeleted() == NULL &&
  818. $entity->getDateIn() <= new \DateTime('+1 seconds')){
  819. $entities->add($entity);
  820. }
  821. }
  822. return $entities;
  823. }
  824.  
  825. /**
  826. * @JMS\VirtualProperty
  827. * @JMS\SerializedName("is_global")
  828. * @JMS\Groups({"detailsUser"})
  829. * @return mixed
  830. */
  831. public function getApiIsGlobal($roles = null)
  832. {
  833. $roles = ($roles == null) ? $this->roles : $roles;
  834.  
  835. if (in_array('ROLE_DATA_MANAGER', $roles, true)) {
  836. return true;
  837. } elseif (in_array('ROLE_GLOBAL_ADMIN', $roles, true)) {
  838. return true;
  839. }
  840.  
  841. return false;
  842. }
  843.  
  844.  
  845. /**
  846. * Get Sels
  847. * @return ArrayCollection
  848. */
  849. public function getSels()
  850. {
  851. $sels = new ArrayCollection();
  852.  
  853. foreach ($this->getUserSels() as $userSel) {
  854. /** @var $userSel UserSel */
  855. $sels->add($userSel->getSel());
  856. }
  857.  
  858. return $sels;
  859. }
  860.  
  861. /**
  862. * Get Patients
  863. * @return ArrayCollection
  864. */
  865. public function getPatients()
  866. {
  867. $patients = new ArrayCollection();
  868.  
  869. foreach ($this->getUserPatients() as $userPatient) {
  870. /** @var $userPatient UserPatient */
  871. $patients->add($userPatient->getPatient());
  872. }
  873.  
  874. return $patients;
  875. }
  876.  
  877. public function isRoot()
  878. {
  879. return $this->email == User::ROOT_EMAIL_ADDRESS;
  880. }
  881.  
  882. public function isGlobal($roles = null)
  883. {
  884. $roles = ($roles == null) ? $this->roles : $roles;
  885.  
  886. if (in_array('ROLE_DATA_MANAGER', $roles, true)) {
  887. return true;
  888. } elseif (in_array('ROLE_GLOBAL_ADMIN', $roles, true)) {
  889. return true;
  890. }
  891.  
  892. return false;
  893. }
  894.  
  895. public function copy()
  896. {
  897.  
  898. $newUser = new User();
  899. $newUser->setFirstname($this->getFirstname());
  900. $newUser->setLastname($this->getLastname());
  901. $newUser->setEmail($this->getEmail());
  902. $newUser->setPassword($this->getPassword());
  903. $newUser->setRoles($this->getRoles());
  904.  
  905. return $newUser;
  906.  
  907. }
  908.  
  909. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement