本文整理汇总了PHP中Admin_DA::addPlacementZone方法的典型用法代码示例。如果您正苦于以下问题:PHP Admin_DA::addPlacementZone方法的具体用法?PHP Admin_DA::addPlacementZone怎么用?PHP Admin_DA::addPlacementZone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Admin_DA
的用法示例。
在下文中一共展示了Admin_DA::addPlacementZone方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: linkCampaign
/**
* A method to link a campaign to a zone
*
* @param int $zoneId
* @param int $campaignId
* @return bool
*/
function linkCampaign($zoneId, $campaignId)
{
if ($this->checkIdExistence('zones', $zoneId)) {
$doZones = OA_Dal::staticGetDO('zones', $zoneId);
if (!$this->checkPermissions(null, 'affiliates', $doZones->affiliateid, OA_PERM_ZONE_LINK)) {
return false;
}
if ($this->checkIdExistence('campaigns', $campaignId)) {
$aLinkedPlacements = Admin_DA::getPlacementZones(array('zone_id' => $zoneId), false, 'placement_id');
if (!isset($aLinkedPlacements[$campaignId])) {
$result = Admin_DA::addPlacementZone(array('zone_id' => $zoneId, 'placement_id' => $campaignId));
if (PEAR::isError($result)) {
$this->raiseError($result->getMessage());
return false;
}
MAX_addLinkedAdsToZone($zoneId, $campaignId);
return true;
} else {
// Already linked
return true;
}
}
}
return false;
}
示例2: MAX_duplicatePlacementZones
function MAX_duplicatePlacementZones($fromPlacementId, $toPlacementId)
{
$pAdZones = Admin_DA::getPlacementZones(array('placement_id' => $fromPlacementId), true, 'zone_id');
if (!empty($pAdZones)) {
foreach ($pAdZones as $zoneId => $placementId) {
Admin_DA::addPlacementZone(array('placement_id' => $toPlacementId, 'zone_id' => $zoneId), false);
}
}
}
示例3: testPlacementZones
function testPlacementZones()
{
TestEnv::startTransaction();
$ret = Admin_DA::addPlacementZone(array('zone_id' => rand(1, 999), 'placement_id' => rand(1, 999)));
$this->assertTrue(is_int($ret));
$this->assertTrue($ret > 0);
$retVar = Admin_DA::getPlacementZones(array('placement_zone_assoc_id' => $ret));
$this->assertTrue(is_array($retVar[$ret]));
TestEnv::rollbackTransaction();
}
示例4: unset
Admin_DA::deletePlacementZones($aParameters);
} else {
Admin_DA::deleteAdZones($aParameters);
}
} else {
// Remove this key, because it is already there and does not need to be added again.
unset($aCurrent[$id]);
}
}
}
$addResult = true;
if (!empty($aCurrent)) {
foreach ($aCurrent as $id => $value) {
$aVariables = array('zone_id' => $zoneId, $key => $id);
if ($view == 'placement') {
$addResult = Admin_DA::addPlacementZone($aVariables);
} else {
$addResult = Admin_DA::addAdZone($aVariables);
}
}
}
if (!$addResult) {
Header("Location: zone-include.php?affiliateid={$publisherId}&zoneid={$zoneId}");
exit;
}
// Move on to the next page
Header("Location: zone-probability.php?affiliateid={$publisherId}&zoneid={$zoneId}");
exit;
}
// Display initial parameters...
$tabIndex = 1;