本文整理匯總了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;
}