Author: Thibault Duplessis (thibault.duplessis@gmail.com)
Author: Johannes M. Schmitt (schmittjoh@gmail.com)
Inheritance: implements FOS\UserBundle\Model\UserInterface, implements FOS\UserBundle\Model\GroupableInterface
Example #1
0
 /**
  * isGranted
  *
  * @param string $grantedRole
  * @param User $user
  * @return bool
  */
 public function isGranted($grantedRole, User $user)
 {
     $grantedRole = new Role($grantedRole);
     if (count($user->getRoles())) {
         foreach ($user->getRoles() as $role) {
             $roles = $this->roleHierarchy->getReachableRoles(array(new Role($role)));
             if (in_array($grantedRole, $roles)) {
                 return true;
             }
         }
     }
     return false;
 }
Example #2
0
 public function __construct()
 {
     parent::__construct();
     $this->requests = new ArrayCollection();
     $this->experience = 0;
     $this->newOauth = false;
 }
Example #3
0
 public function __construct()
 {
     parent::__construct();
     // your own logic
     $this->commandes = new \Doctrine\Common\Collections\ArrayCollection();
     $this->adresses = new \Doctrine\Common\Collections\ArrayCollection();
 }
Example #4
0
 public function __construct()
 {
     parent::__construct();
     // your own logic
     $this->usuario_adopciones = new ArrayCollection();
     $this->usuario_archivos = new ArrayCollection();
 }
Example #5
0
 public function __construct()
 {
     parent::__construct();
     $this->postsCreated = new ArrayCollection();
     $this->tagsCreated = new ArrayCollection();
     // your own logic
 }
Example #6
0
 public function __construct()
 {
     parent::__construct();
     $this->folders = new ArrayCollection();
     $this->events = new ArrayCollection();
     $this->enabled = 0;
 }
Example #7
0
 public function __construct($class)
 {
     parent::__construct($class);
     //$now = new \Datetime();
     //$this->created = $now;
     //$this->updated = $now;
 }
Example #8
0
 public function __construct()
 {
     parent::__construct();
     $this->address = new \Doctrine\Common\Collections\ArrayCollection();
     $this->orders = new \Doctrine\Common\Collections\ArrayCollection();
     $this->userImg = new \Doctrine\Common\Collections\ArrayCollection();
 }
Example #9
0
 public function __construct()
 {
     parent::__construct();
     $this->forumQuestions = new ArrayCollection();
     $this->forumAnswers = new ArrayCollection();
     $this->lots = new ArrayCollection();
 }
Example #10
0
 public function __construct()
 {
     parent::__construct();
     $this->files = new ArrayCollection();
     $this->directories = new ArrayCollection();
     $this->playlists = new ArrayCollection();
 }
Example #11
0
 public function __construct()
 {
     parent::__construct();
     $this->addRole('ROLE_USER');
     $this->autoPassword = false;
     $this->autoUsername = false;
 }
Example #12
0
 public function __construct()
 {
     $this->artigos = new ArrayCollection();
     $this->mensagens = new ArrayCollection();
     $this->topicos = new ArrayCollection();
     parent::__construct();
 }
Example #13
0
 public function setUsername($username)
 {
     parent::setUsername($username);
     // El email se configura automáticamente.
     $this->setEmail($username . '@uco.es');
     return $this;
 }
Example #14
0
 public function __construct()
 {
     parent::__construct();
     $this->products = new ArrayCollection();
     $this->orders = new ArrayCollection();
     $this->address = new ArrayCollection();
 }
Example #15
0
 /**
  * User constructor.
  */
 public function __construct()
 {
     parent::__construct();
     $this->isActive = true;
     // may not be needed, see section on salt below
     // $this->salt = md5(uniqid(null, true));
 }
Example #16
0
 public function __construct()
 {
     parent::__construct();
     $this->groups = new \Doctrine\Common\Collections\ArrayCollection();
     $this->courses = new \Doctrine\Common\Collections\ArrayCollection();
     $this->payments = new \Doctrine\Common\Collections\ArrayCollection();
 }
Example #17
0
 public function __construct()
 {
     parent::__construct();
     // your own logic
     $this->passwordExpireAt = new \DateTime('next month');
     $this->roles = new ArrayCollection();
 }
Example #18
0
 public function __construct()
 {
     parent::__construct();
     // your own logic
     $this->blog = new ArrayCollection();
     $this->comments = new ArrayCollection();
 }
Example #19
0
 /**
  * Set email
  *
  * @return string
  */
 public function setEmail($email)
 {
     $email = is_null($email) ? '' : $email;
     parent::setEmail($email);
     $this->setUsername($email);
     return $this;
 }
Example #20
0
 public function __construct()
 {
     parent::__construct();
     if (empty($this->roles)) {
         $this->roles[] = 'ROLE_USER';
     }
 }
Example #21
0
 /**
  * Constructor
  */
 public function __construct()
 {
     parent::__construct();
     $this->articles = new ArrayCollection();
     $this->ratings = new ArrayCollection();
     $this->answers = new ArrayCollection();
 }
Example #22
0
 /**
  * Constructor
  */
 public function __construct()
 {
     parent::__construct();
     $this->enabled = true;
     $this->username = microtime();
     $this->username_canonical = $this->username;
 }
Example #23
0
 /**
  * *******************************************************
  * Constructor
  * *******************************************************
  */
 public function __construct()
 {
     parent::__construct();
     $this->setSubscribe(true);
     $this->invoices = new ArrayCollection();
     $this->reviews = new ArrayCollection();
 }
Example #24
0
 public function __construct()
 {
     parent::__construct();
     $this->modulos = new ArrayCollection();
     $this->createdAt = new \DateTime();
     $this->updatedAt = $this->createdAt;
 }
Example #25
0
 public function __construct()
 {
     parent::__construct();
     // your own logic
     $this->stadiums = new ArrayCollection();
     $this->bookings = new ArrayCollection();
 }
Example #26
0
 public function __construct()
 {
     parent::__construct();
     $this->setCreatedAt(new \DateTime());
     $this->setUpdatedAt(new \DateTime());
     $this->characters = new ArrayCollection();
 }
Example #27
0
 /**
  * User constructor.
  */
 public function __construct()
 {
     parent::__construct();
     $this->authored_tickets = new ArrayCollection();
     $this->assigned_tickets = new ArrayCollection();
     $this->workers = new ArrayCollection();
 }
Example #28
0
 public function __construct()
 {
     parent::__construct();
     if (in_array('ROLE_API', $this->getRoles())) {
         $this->setApiKey(ApiKeyGenerator::generate());
     }
 }
Example #29
0
 public function __construct()
 {
     parent::__construct();
     $this->infos = new \Doctrine\Common\Collections\ArrayCollection();
     $this->articles = new \Doctrine\Common\Collections\ArrayCollection();
     $this->comments = new \Doctrine\Common\Collections\ArrayCollection();
 }
Example #30
0
 public function __construct()
 {
     parent::__construct();
     $this->{$commentaires} = new ArrayCollection();
     $this->{$commandesTraites} = new ArrayCollection();
     $this->{$commandesEnvoyes} = new ArrayCollection();
 }