本文整理汇总了PHP中UserPeer::doSelect方法的典型用法代码示例。如果您正苦于以下问题:PHP UserPeer::doSelect方法的具体用法?PHP UserPeer::doSelect怎么用?PHP UserPeer::doSelect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserPeer
的用法示例。
在下文中一共展示了UserPeer::doSelect方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
public function execute(&$value, &$error)
{
$c = new Criteria();
$c->add(UserPeer::EMAIL, $value);
$users = UserPeer::doSelect($c);
// if it's unique
if (0 === count($users)) {
return true;
} else {
if (count($users) > 1) {
$error = $this->getParameter('unique_error');
return false;
} else {
$user = array_pop($users);
/* @var $user User */
$loggedInUser = sfContext::getInstance()->getUser()->getRaykuUser();
if ($loggedInUser instanceof User) {
// if the logged in user matches the found user, then it's allowed to be the same email address
if ($loggedInUser->equals($user)) {
return true;
} else {
$error = $this->getParameter('unique_error');
return false;
}
} else {
// we're not logged in, so die
throw new sfValidatorException('you need to be logged in to validate your email address');
}
}
}
$error = $this->getParameter('unique_error');
return false;
}
示例2: getNonMembers
public function getNonMembers($c = null)
{
$c = UserPeer::getNonUsergroupCriteria($this->getId(), $c);
$c->addAscendingOrderByColumn(UserPeer::FAMILY_NAME);
$c->addAscendingOrderByColumn(UserPeer::SURNAME);
return UserPeer::doSelect($c);
}
示例3: getAllInterestedUsers
public function getAllInterestedUsers()
{
$c = new Criteria();
$c->addJoin(UserPeer::ID, InterestPeer::USER_ID, Criteria::LEFT_JOIN);
$c->add(InterestPeer::QUESTION_ID, $this->getId());
return UserPeer::doSelect($c);
}
示例4: executeList
public function executeList(sfWebRequest $request)
{
$c = new Criteria();
$c->add(UserPeer::STATUS, Constant::RECORD_STATUS_DELETED, Criteria::NOT_EQUAL);
$c->addAscendingOrderByColumn(UserPeer::EMPLOYEE_ID);
$this->users = UserPeer::doSelect($c);
}
示例5: execute
public function execute(&$value, &$error)
{
$c = new Criteria();
$c->add(UserPeer::EMAIL, $value);
$users = UserPeer::doSelect($c);
// if it's not found
if (0 === count($users)) {
$error = $this->getParameter('invalid_error');
return false;
}
return true;
}
示例6: executeAutocomplete
public function executeAutocomplete()
{
//Find the e-mail addresses of banned users that're like the one typed
$c = new Criteria();
if ($this->getRequestParameter('hidden') == 'yes') {
$c->add(UserPeer::HIDDEN, true);
} else {
$c->add(UserPeer::HIDDEN, false);
}
$c->add(UserPeer::USERNAME, $this->getRequestParameter('username') . '%', Criteria::LIKE);
$c->setLimit(25);
//Send that list to the template
$this->users = UserPeer::doSelect($c);
}
示例7: executeSubmit
public function executeSubmit(sfWebRequest $request)
{
$user = new User();
$c = new Criteria();
$c->add(UserPeer::USERNAME, $request->getParameter('user_name'));
$c->add(UserPeer::PASSWORD, $request->getParameter('password'));
$user_array = UserPeer::doSelect($c);
$user = $this->getUser();
if (sizeof($user_array) <= 0) {
$user->setAuthenticated(false);
return sfView::ERROR;
}
$user_class = new User();
$user_class = $user_array[0];
$user->setAttribute('userId', $user_class->getUserid());
$user->setAuthenticated(true);
}
示例8: getSysadmin
public function getSysadmin()
{
$c = new Criteria();
$users = UserPeer::doSelect($c);
foreach ($users as $user1) {
$userrole = $user1->getUserRoles();
$found = false;
foreach ($userroles as $userrole) {
if ($userrole . getRole()->getName() == 'sysadmin') {
$found = true;
break;
}
}
if (found == true) {
return $user1;
}
}
return null;
}
示例9: checkUser
function checkUser($userEmail, $userPassword)
{
global $firephp;
$c = new Criteria();
$c->add(UserPeer::USEREMAIL, $userEmail);
$user = UserPeer::doSelect($c);
$firephp->log($user, 'user');
if (count($user) != 1) {
return false;
} else {
$firephp->log($user[0]->getUserpwd(), 'password Bdd');
$firephp->log($userPassword, 'password user');
//controle du password
if (!strcmp($user[0]->getUserpwd(), $userPassword)) {
return $user[0];
//login ok le password est bon
} else {
return false;
}
}
}
示例10: executeSendmail
public function executeSendmail()
{
$c = new Criteria();
$users = UserPeer::doSelect($c);
foreach ($users as $user) {
$this->mail = Mailman::createCleanMailer();
$subject = $_POST['massmail_subject'];
$this->mail->setSubject($subject);
$this->mail->setFrom("Rayku < admin@rayku.com >");
$to = $user->getEmail();
sfProjectConfiguration::getActive()->loadHelpers(array('Partial'));
$this->mail->setBody($_POST['massmail_content']);
$this->mail->setContentType('text/html');
$this->mail->addAddress($to);
$this->mail->send();
if ($this->mail) {
$_SESSION['mailsent'] = 1;
}
}
$this->redirect('massmail/index');
}
示例11: executeIndex
public function executeIndex()
{
$a = new Criteria();
$users = UserPeer::doSelect($a);
//print_r($users);
$onlineusers = 0;
foreach ($users as $user) {
if ($user->isOnline()) {
$onlineusers = $onlineusers + 1;
}
}
//echo $onlineusers;
$onlineusers = $onlineusers;
if ($onlineusers == 0) {
$onlineusers_msg = "(All members are in offline)";
}
if ($onlineusers == 1) {
$onlineusers_msg = "(One member is in online)";
}
if ($onlineusers > 1) {
$onlineusers_msg = "({$onlineusers} members are in online)";
}
$this->onlineusers_msg = $onlineusers_msg;
if (!empty($_COOKIE["timer"])) {
$this->redirect('/dashboard/rating');
}
if (!empty($_GET['post_id'])) {
$this->getResponse()->setCookie("_post_Id", $_GET['post_id'], time() + 600, '/', sfConfig::get('app_cookies_domain'));
$_COOKIE['_post_Id'] = 100;
}
$c = new Criteria();
$c->add(ForumPeer::TYPE, 0);
$this->publicforums = ForumPeer::doSelect($c);
$this->categories = CategoryPeer::doSelect(new Criteria());
$l = new Criteria();
$l->addDescendingOrderByColumn(ThreadPeer::ID);
$l->add(ThreadPeer::CANCEL, 0);
$l->setLimit(5);
$this->latest = ThreadPeer::doSelect($l);
}
示例12: executeList
public function executeList()
{
$this->users = UserPeer::doSelect(new Criteria());
}
示例13: getLoginName
public function getLoginName($email_address)
{
$a = explode("@", $email_address);
$c = new Criteria();
$c->add(UserPeer::EMAIL_LOCAL_PART, $a[0]);
$login = UserPeer::doSelect($c);
return $login->getLogin();
}
示例14: getUserByName
private function getUserByName($keyword)
{
$departmentAvailable = $this->cmsTools->departmentAvailable($this->department->getId());
$criteria = new Criteria();
$criteria->add(UserPeer::LOGIN, '%' . $keyword . '%', Criteria::LIKE);
$criteria->add(UserPeer::DEPARTMENT_ID, $departmentAvailable, Criteria::IN);
$user = UserPeer::doSelect($criteria);
$userId = array();
foreach ($user as $u) {
$userId[] = $u->getId();
}
return $userId;
}
示例15: doDelete
public static function doDelete($values, PropelPDO $con = null)
{
if ($con === null) {
$con = Propel::getConnection(PagePeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
}
if ($values instanceof Criteria) {
// rename for clarity
$criteria = clone $values;
} elseif ($values instanceof User) {
// it's a model object
// create criteria based on pk values
$criteria = $values->buildPkeyCriteria();
} else {
// it's a primary key, or an array of pks
$criteria = new Criteria(self::DATABASE_NAME);
$criteria->add(PagePeer::ID, (array) $values, Criteria::IN);
}
foreach (UserPeer::doSelect(clone $criteria, $con) as $object) {
TagPeer::deleteTagsForObject($object);
}
return self::doDeleteBeforeTaggable($criteria, $con);
}