Newscoop\Entity\User\Group::getRoleId PHP Метод

getRoleId() публичный Метод

Get role id
public getRoleId ( ) : integer
Результат integer
    public function getRoleId()
    {
        return $this->role ? $this->role->getId() : 0;
    }

Usage Example

Пример #1
0
 /**
  * Save group
  *
  * @param Newscoop\Entity\User\Group $group
  * @param array $values
  * @return void
  */
 public function save(Group $group, array $values)
 {
     $em = $this->getEntityManager();
     $group->setName($values['name']);
     if (!$group->getRoleId()) {
         $role = new Role();
         $em->persist($role);
         $group->setRole($role);
     }
     $em->persist($group);
     $em->flush();
 }
All Usage Examples Of Newscoop\Entity\User\Group::getRoleId