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