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
Exemplo n.º 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;
 }
Exemplo n.º 2
0
 public function __construct()
 {
     parent::__construct();
     $this->requests = new ArrayCollection();
     $this->experience = 0;
     $this->newOauth = false;
 }
Exemplo n.º 3
0
 public function __construct()
 {
     parent::__construct();
     // your own logic
     $this->commandes = new \Doctrine\Common\Collections\ArrayCollection();
     $this->adresses = new \Doctrine\Common\Collections\ArrayCollection();
 }
Exemplo n.º 4
0
 public function __construct()
 {
     parent::__construct();
     // your own logic
     $this->usuario_adopciones = new ArrayCollection();
     $this->usuario_archivos = new ArrayCollection();
 }
Exemplo n.º 5
0
 public function __construct()
 {
     parent::__construct();
     $this->postsCreated = new ArrayCollection();
     $this->tagsCreated = new ArrayCollection();
     // your own logic
 }
Exemplo n.º 6
0
 public function __construct()
 {
     parent::__construct();
     $this->folders = new ArrayCollection();
     $this->events = new ArrayCollection();
     $this->enabled = 0;
 }
Exemplo n.º 7
0
 public function __construct($class)
 {
     parent::__construct($class);
     //$now = new \Datetime();
     //$this->created = $now;
     //$this->updated = $now;
 }
Exemplo n.º 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();
 }
Exemplo n.º 9
0
 public function __construct()
 {
     parent::__construct();
     $this->forumQuestions = new ArrayCollection();
     $this->forumAnswers = new ArrayCollection();
     $this->lots = new ArrayCollection();
 }
Exemplo n.º 10
0
 public function __construct()
 {
     parent::__construct();
     $this->files = new ArrayCollection();
     $this->directories = new ArrayCollection();
     $this->playlists = new ArrayCollection();
 }
Exemplo n.º 11
0
 public function __construct()
 {
     parent::__construct();
     $this->addRole('ROLE_USER');
     $this->autoPassword = false;
     $this->autoUsername = false;
 }
Exemplo n.º 12
0
 public function __construct()
 {
     $this->artigos = new ArrayCollection();
     $this->mensagens = new ArrayCollection();
     $this->topicos = new ArrayCollection();
     parent::__construct();
 }
Exemplo n.º 13
0
 public function setUsername($username)
 {
     parent::setUsername($username);
     // El email se configura automáticamente.
     $this->setEmail($username . '@uco.es');
     return $this;
 }
Exemplo n.º 14
0
 public function __construct()
 {
     parent::__construct();
     $this->products = new ArrayCollection();
     $this->orders = new ArrayCollection();
     $this->address = new ArrayCollection();
 }
Exemplo n.º 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));
 }
Exemplo n.º 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();
 }
Exemplo n.º 17
0
 public function __construct()
 {
     parent::__construct();
     // your own logic
     $this->passwordExpireAt = new \DateTime('next month');
     $this->roles = new ArrayCollection();
 }
Exemplo n.º 18
0
 public function __construct()
 {
     parent::__construct();
     // your own logic
     $this->blog = new ArrayCollection();
     $this->comments = new ArrayCollection();
 }
Exemplo n.º 19
0
 /**
  * Set email
  *
  * @return string
  */
 public function setEmail($email)
 {
     $email = is_null($email) ? '' : $email;
     parent::setEmail($email);
     $this->setUsername($email);
     return $this;
 }
Exemplo n.º 20
0
 public function __construct()
 {
     parent::__construct();
     if (empty($this->roles)) {
         $this->roles[] = 'ROLE_USER';
     }
 }
Exemplo n.º 21
0
 /**
  * Constructor
  */
 public function __construct()
 {
     parent::__construct();
     $this->articles = new ArrayCollection();
     $this->ratings = new ArrayCollection();
     $this->answers = new ArrayCollection();
 }
Exemplo n.º 22
0
 /**
  * Constructor
  */
 public function __construct()
 {
     parent::__construct();
     $this->enabled = true;
     $this->username = microtime();
     $this->username_canonical = $this->username;
 }
Exemplo n.º 23
0
 /**
  * *******************************************************
  * Constructor
  * *******************************************************
  */
 public function __construct()
 {
     parent::__construct();
     $this->setSubscribe(true);
     $this->invoices = new ArrayCollection();
     $this->reviews = new ArrayCollection();
 }
Exemplo n.º 24
0
 public function __construct()
 {
     parent::__construct();
     $this->modulos = new ArrayCollection();
     $this->createdAt = new \DateTime();
     $this->updatedAt = $this->createdAt;
 }
Exemplo n.º 25
0
 public function __construct()
 {
     parent::__construct();
     // your own logic
     $this->stadiums = new ArrayCollection();
     $this->bookings = new ArrayCollection();
 }
Exemplo n.º 26
0
 public function __construct()
 {
     parent::__construct();
     $this->setCreatedAt(new \DateTime());
     $this->setUpdatedAt(new \DateTime());
     $this->characters = new ArrayCollection();
 }
Exemplo n.º 27
0
 /**
  * User constructor.
  */
 public function __construct()
 {
     parent::__construct();
     $this->authored_tickets = new ArrayCollection();
     $this->assigned_tickets = new ArrayCollection();
     $this->workers = new ArrayCollection();
 }
Exemplo n.º 28
0
 public function __construct()
 {
     parent::__construct();
     if (in_array('ROLE_API', $this->getRoles())) {
         $this->setApiKey(ApiKeyGenerator::generate());
     }
 }
Exemplo n.º 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();
 }
Exemplo n.º 30
0
 public function __construct()
 {
     parent::__construct();
     $this->{$commentaires} = new ArrayCollection();
     $this->{$commandesTraites} = new ArrayCollection();
     $this->{$commandesEnvoyes} = new ArrayCollection();
 }