本文整理汇总了PHP中PermissionPeer::retrieveByPK方法的典型用法代码示例。如果您正苦于以下问题:PHP PermissionPeer::retrieveByPK方法的具体用法?PHP PermissionPeer::retrieveByPK怎么用?PHP PermissionPeer::retrieveByPK使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PermissionPeer
的用法示例。
在下文中一共展示了PermissionPeer::retrieveByPK方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: tearDown
/**
* Cleans up the environment after running a test.
*/
protected function tearDown()
{
UserRolePeer::clearInstancePool();
PermissionPeer::clearInstancePool();
PermissionItemPeer::clearInstancePool();
kuserPeer::clearInstancePool();
PartnerPeer::clearInstancePool();
$this->client = null;
PermissionPeer::setUseCriteriaFilter(false);
foreach ($this->addedPermissionIds as $id) {
try {
$obj = PermissionPeer::retrieveByPK($id);
if ($obj) {
$obj->delete();
}
} catch (PropelException $e) {
}
}
PermissionPeer::setUseCriteriaFilter(true);
$this->addedPermissionIds = array();
parent::tearDown();
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:25,代码来源:PermissionServiceUnitTest.php
示例2: executeSave
/**
* Saves new or update role. Echoes error/success message
*/
public function executeSave(sfWebRequest $request)
{
$id = $request->getParameter('id');
if ($id) {
$role = PermissionPeer::retrieveByPK($id);
if (!$role instanceof Permission) {
return $this->renderText('<span style="color:red;">Right not found or is removed!</span>');
}
$form = new PermissionForm($role);
} else {
$form = new PermissionForm();
}
unset($form['_csrf_token']);
$form->bind($request->getPostParameters());
if ($form->isValid()) {
$form->save();
return $this->renderText('Right has been successfully saved!');
} else {
echo 'e1';
# has error
echo '<span style="color:red;">';
$i = 0;
if ($form['title']->hasError()) {
echo $form['title']->getError()->getMessage();
$i++;
}
if ($form['code']->hasError()) {
if ($i) {
echo '<br/>';
}
echo $form['code']->getError()->getMessage();
}
echo '</span>';
}
return sfView::NONE;
}