Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace SeguridadBundle\Entity;
- use Doctrine\Common\Collections\ArrayCollection;
- use FOS\UserBundle\Model\User as BaseUser;
- use Doctrine\ORM\Mapping as ORM;
- use Symfony\Component\Validator\Constraints as Assert;
- /**
- * User
- *
- * @ORM\Entity
- * @ORM\Table(name="fos_user")
- */
- class User extends BaseUser
- {
- public function __toString()
- {
- return $this->getEmail();
- }
- public function __construct()
- {
- parent::__construct();
- $this->observaciones = new ArrayCollection();
- }
- /**
- * @ORM\Id
- * @ORM\Column(type="integer")
- * @ORM\GeneratedValue(strategy="AUTO")
- */
- protected $id;
- /**
- * GRUPOS
- * @ORM\OneToMany(targetEntity="SeguridadBundle\Entity\UserGroup", mappedBy="cuenta", cascade={"persist", "remove"})
- */
- private $grupos;
- /**
- * @ORM\OneToMany(targetEntity="DeteccionBundle\Entity\ObservacionEquipo", mappedBy="usuario", cascade={"persist", "remove"})
- */
- private $observaciones;
- // RELACION CPU -- PANTALLAS ////////
- //////////////////////////////////
- public function setObservaciones(\Doctrine\Common\Collections\Collection $observaciones)
- {
- $this->observaciones = $observaciones;
- foreach ($observaciones as $obser) {
- $obser->setUsuario($this);
- }
- }
- /**
- * Add grupo
- *
- * @param \SeguridadBundle\Entity\UserGroup $grupo
- *
- * @return User
- */
- public function addGrupo(\SeguridadBundle\Entity\UserGroup $grupo)
- {
- $this->grupos[] = $grupo;
- return $this;
- }
- /**
- * Remove grupo
- *
- * @param \SeguridadBundle\Entity\UserGroup $grupo
- */
- public function removeGrupo(\SeguridadBundle\Entity\UserGroup $grupo)
- {
- $this->grupos->removeElement($grupo);
- }
- /**
- * Get grupos
- *
- * @return \Doctrine\Common\Collections\Collection
- */
- public function getGrupos()
- {
- return $this->grupos;
- }
- /**
- * Remove observacione
- *
- * @param \DeteccionBundle\Entity\ObservacionEquipo $observacione
- */
- public function removeObservacione(\DeteccionBundle\Entity\ObservacionEquipo $observacione)
- {
- $this->observaciones->removeElement($observacione);
- }
- /**
- * Get observaciones
- *
- * @return \Doctrine\Common\Collections\Collection
- */
- public function getObservaciones()
- {
- return $this->observaciones;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement