当前位置: 首页>>代码示例>>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;未经允许,请勿转载。