本文整理汇总了PHP中entryPeer::updateAccessControl方法的典型用法代码示例。如果您正苦于以下问题:PHP entryPeer::updateAccessControl方法的具体用法?PHP entryPeer::updateAccessControl怎么用?PHP entryPeer::updateAccessControl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类entryPeer
的用法示例。
在下文中一共展示了entryPeer::updateAccessControl方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: preSave
public function preSave(PropelPDO $con = null)
{
if ($this->isColumnModified(accessControlPeer::DELETED_AT)) {
if ($this->isDefault === true) {
throw new kCoreException("Default access control profile [" . $this->getId() . "] can't be deleted", kCoreException::ACCESS_CONTROL_CANNOT_DELETE_PARTNER_DEFAULT);
}
$defaultAccessControl = $this->getPartner()->getDefaultAccessControlId();
if (!$defaultAccessControl) {
throw new kCoreException("no default access control on partner", kCoreException::NO_DEFAULT_ACCESS_CONTROL);
}
entryPeer::updateAccessControl($this->getPartnerId(), $this->id, $defaultAccessControl);
}
return parent::preSave($con);
}
示例2: deleteAction
/**
* Delete Access Control Profile by id
*
* @action delete
* @param int $id
*/
function deleteAction($id)
{
$dbAccessControl = accessControlPeer::retrieveByPK($id);
if (!$dbAccessControl) {
throw new KalturaAPIException(KalturaErrors::ACCESS_CONTROL_ID_NOT_FOUND, $id);
}
if ($dbAccessControl->getIsDefault()) {
throw new KalturaAPIException(KalturaErrors::CANNOT_DELETE_DEFAULT_ACCESS_CONTROL);
}
$c = new Criteria();
$c->add(entryPeer::ACCESS_CONTROL_ID, $dbAccessControl->getId());
// move entries to the default access control
$entryCount = entryPeer::doCount($c);
if ($entryCount > 0) {
entryPeer::updateAccessControl($this->getPartnerId(), $id, $this->getPartner()->getDefaultAccessControlId());
}
$dbAccessControl->setDeletedAt(time());
$dbAccessControl->save();
}