本文整理汇总了PHP中Admin_DA::addLimitation方法的典型用法代码示例。如果您正苦于以下问题:PHP Admin_DA::addLimitation方法的具体用法?PHP Admin_DA::addLimitation怎么用?PHP Admin_DA::addLimitation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Admin_DA
的用法示例。
在下文中一共展示了Admin_DA::addLimitation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _duplicateAd
function _duplicateAd($aAd, $checkUniqueNames = false)
{
require_once MAX_PATH . '/www/admin/lib-storage.inc.php';
// Copy the linked creative
$newFile = phpAds_ImageDuplicate($aAd['type'], $aAd['filename']);
if ($newFile !== false) {
$aAd['filename'] = $newFile;
}
// Remove the existing advert id
$adId = $aAd['ad_id'];
unset($aAd['ad_id']);
// Check for unique names
if ($checkUniqueNames) {
$aAds = Admin_DA::getAds(array('placement_id' => $aAd['placement_id']));
Admin_DA::_getUniqueName($aAd, $aAds, $GLOBALS['strCopy']);
}
// Add the new ad
$newAdId = Admin_DA::addAd($aAd);
// Copy the limitations
$aLimitations = Admin_DA::getDeliveryLimitations(array('ad_id' => $adId));
foreach ($aLimitations as $aLimitation) {
$aLimitation['ad_id'] = $newAdId;
Admin_DA::addLimitation($aLimitation);
}
// Copy the zone ad associations
$aAdZones = Admin_DA::getAdZones(array('ad_id' => $adId));
foreach ($aAdZones as $aAdZone) {
$aAdZone['ad_id'] = $newAdId;
Admin_DA::duplicateAdZone($aAdZone);
}
return $newAdId;
}