コード例 #1
0
ファイル: UserSvc.php プロジェクト: berliozd/cherbouquin
 /**
  *
  * @param type $lastname
  * @param type $firstname
  * @param type $username
  * @param type $email
  * @return \Sb\Db\Model\User
  */
 public function addLightUser($lastname, $firstname, $username, $email, $password)
 {
     $user = null;
     $userTmp = new User();
     // Création du user dans la table s1b_users
     $userTmp->setToken(sha1(uniqid(rand())));
     $userTmp->setEmail($email);
     $userTmp->setFirstName($firstname);
     $userTmp->setLastName($lastname);
     $userTmp->setPassword(sha1($password));
     $userTmp->setUserName($username);
     $userTmp->setToken(sha1(uniqid(rand())));
     $userTmp->setDeleted(false);
     $userTmp->setActivated(false);
     $userTmp->setConnexionType(\Sb\Entity\ConnexionType::SHARE1BOOK);
     $userTmp->setGender("");
     $userTmp->setFacebookLanguage("");
     $userTmp->setTokenFacebook("");
     $userTmp->setPicture("");
     $userTmp->setPictureBig("");
     $setting = new UserSetting();
     UserSettingHelper::loadDefaultSettings($setting);
     $userTmp->setSetting($setting);
     $user = UserDao::getInstance()->add($userTmp);
     return $user;
 }
コード例 #2
0
ファイル: UserMapper.php プロジェクト: berliozd/cherbouquin
 public static function mapFromFacebookUser(\Sb\Db\Model\User &$user, \Sb\Facebook\Model\FacebookUser $faceBookUser)
 {
     $user->setFacebookId($faceBookUser->getUid());
     $user->setConnexionType(\Sb\Entity\ConnexionType::FACEBOOK);
     $user->setFirstName($faceBookUser->getFirst_name());
     $user->setLastName($faceBookUser->getLast_name());
     $user->setUserName($faceBookUser->getName());
     $user->setEmail($faceBookUser->getEmail());
     $user->setGender($faceBookUser->getSex());
     $user->setCity($faceBookUser->getHometown_location());
     $user->setBirthDay($faceBookUser->getBirthday());
     $user->setFacebookLanguage($faceBookUser->getLocale());
     $user->setTokenFacebook(sha1(uniqid(rand())));
     $user->setActivated(true);
     $user->setPicture($faceBookUser->getPic_small());
     $user->setPictureBig($faceBookUser->getPic());
 }
コード例 #3
0
 public function setPicture($picture)
 {
     $this->__load();
     return parent::setPicture($picture);
 }