本文整理匯總了PHP中assetPeer::countByEntryId方法的典型用法代碼示例。如果您正苦於以下問題:PHP assetPeer::countByEntryId方法的具體用法?PHP assetPeer::countByEntryId怎麽用?PHP assetPeer::countByEntryId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類assetPeer
的用法示例。
在下文中一共展示了assetPeer::countByEntryId方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: preInsert
public function preInsert(PropelPDO $con = null)
{
//Validate max assets limitation was not reached before doing insert
$partner = PartnerPeer::retrieveByPK($this->getPartnerId());
if ($partner) {
$assetPerEntryLimitation = $partner->getAssetsPerEntryLimitation();
}
if (!isset($assetPerEntryLimitation) || $assetPerEntryLimitation == false) {
$assetPerEntryLimitation = self::MAX_ASSETS_PER_ENTRY;
}
$assetsCount = assetPeer::countByEntryId($this->entry_id);
if ($assetsCount + 1 > $assetPerEntryLimitation) {
throw new kCoreException("Max number of allowed assets per entry was reached", kCoreException::MAX_ASSETS_PER_ENTRY);
}
return parent::preInsert();
}