private function creatGroup($username, $password, $officialName, $groupType, $parent = null) { $stateGroup = new Group(); $stateGroup->setUsername($username); $stateGroup->setManagerEmail(self::COMMON_STATE_GROUP_EMAIL); $stateGroup->setOfficialName($officialName); $stateGroup->setGroupType($groupType); $stateGroup->setParent($parent); $stateGroup->setLocationName($username); $generator = new SecureRandom(); $factory = $this->container->get('security.encoder_factory'); $encoder = $factory->getEncoder($stateGroup); $password = $encoder->encodePassword(sha1($generator->nextBytes(10)), $stateGroup->getSalt()); $stateGroup->setPassword($password); return $stateGroup; }
public function setLocationName($locationName) { $this->__load(); return parent::setLocationName($locationName); }