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); }
/** * @param sfGuardUserGroup $sfGuardUserGroup The sfGuardUserGroup object to add. */ protected function doAddsfGuardUserGroup($sfGuardUserGroup) { $this->collsfGuardUserGroups[] = $sfGuardUserGroup; $sfGuardUserGroup->setsfGuardGroup($this); }
public function addsfGuardUserGroup(sfGuardUserGroup $l) { $this->collsfGuardUserGroups[] = $l; $l->setsfGuardGroup($this); }