Пример #1
0
 public function addGroupByName($name, $con = null)
 {
     $group = Doctrine::getTable('sfGuardGroup')->findOneByName($name);
     if (!$group) {
         throw new Exception(sprintf('The group "%s" does not exist.', $name));
     }
     $ug = new sfGuardUserGroup();
     $ug->setsfGuardUser($this);
     $ug->setsfGuardGroup($group);
     $ug->save($con);
 }
Пример #2
0
 public function addGroupByName($name, $con = null)
 {
     $group = sfGuardGroupPeer::retrieveByName($name);
     if (!$group) {
         throw new Exception(sprintf('The group "%s" does not exist.', $name));
     }
     $ug = new sfGuardUserGroup();
     $ug->setsfGuardUser($this);
     $ug->setGroupId($group->getId());
     $ug->save($con);
 }
Пример #3
0
 /**
  * @param	sfGuardUserGroup $sfGuardUserGroup The sfGuardUserGroup object to add.
  */
 protected function doAddsfGuardUserGroup($sfGuardUserGroup)
 {
     $this->collsfGuardUserGroups[] = $sfGuardUserGroup;
     $sfGuardUserGroup->setsfGuardUser($this);
 }
Пример #4
0
 public function addsfGuardUserGroup(sfGuardUserGroup $l)
 {
     $this->collsfGuardUserGroups[] = $l;
     $l->setsfGuardUser($this);
 }