當前位置: 首頁>>代碼示例>>PHP>>正文


PHP sfGuardUser::getPrimaryKey方法代碼示例

本文整理匯總了PHP中sfGuardUser::getPrimaryKey方法的典型用法代碼示例。如果您正苦於以下問題:PHP sfGuardUser::getPrimaryKey方法的具體用法?PHP sfGuardUser::getPrimaryKey怎麽用?PHP sfGuardUser::getPrimaryKey使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在sfGuardUser的用法示例。


在下文中一共展示了sfGuardUser::getPrimaryKey方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: removeFollower

 public function removeFollower(sfGuardUser $user)
 {
     $assoFollower = AbonnementTable::getInstance()->getCurrentAssoFollower($this->getPrimaryKey(), $user->getPrimaryKey())->fetchOne();
     $assoFollower->delete();
 }
開發者ID:TheoJD,項目名稱:portail,代碼行數:5,代碼來源:Asso.class.php

示例2: _create_object

// objects creation
$object1 = _create_object();
$object1->setName('one');
$object1->save();
$object2 = _create_object();
$object2->setName('two');
$object2->save();
$user1 = new sfGuardUser();
$user1->setUsername('one');
$user1->save();
$t->ok(is_numeric($object1->getRecommendationScore()), 'getRecommendationScore() returns numeric value');
$t->is($object1->getRecommendationScore(), 0, 'getRecommendationScore() object 1 score initialized : 0');
$t->ok($object1->recommend(), 'recommend() object 1');
$t->is($object1->getRecommendationScore(), 1, 'getRecommendationScore() object 1 score updated : 1');
$object2->recommend();
$object2->recommend();
$object2->recommend();
$t->is($object1->getRecommendationScore(), 1, 'getRecommendationScore() object 1 score not updated : 1');
$t->is($object2->getRecommendationScore(), 3, 'getRecommendationScore() object 2 score updated : 3');
$t->ok($object1->recommend($user1->getPrimaryKey()), 'recommend() a user can recommend object 1 once');
$t->ok(!$object1->recommend($user1->getPrimaryKey()), 'recommend() a user cannot recommend object 1 twice');
$t->ok($object2->recommend($user1->getPrimaryKey()), 'recommend() a user can recommend object 2');
// test object creation
function _create_object()
{
    $classname = TEST_CLASS;
    if (!class_exists($classname)) {
        throw new Exception(sprintf('Unknow class "%s"', $classname));
    }
    return new $classname();
}
開發者ID:sgrove,項目名稱:cothinker,代碼行數:31,代碼來源:sfPropelActAsRecommendableBehaviorTest.php

示例3: removeFollower

 public function removeFollower(sfGuardUser $user, Service $service)
 {
     $assoFollower = MembreServiceTable::getInstance()->getCurrentServiceFollower($service->getPrimaryKey(), $user->getPrimaryKey())->fetchOne();
     $assoFollower->delete();
 }
開發者ID:TheoJD,項目名稱:portail,代碼行數:5,代碼來源:Service.class.php


注:本文中的sfGuardUser::getPrimaryKey方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。