本文整理汇总了PHP中Admin_DA::addTracker方法的典型用法代码示例。如果您正苦于以下问题:PHP Admin_DA::addTracker方法的具体用法?PHP Admin_DA::addTracker怎么用?PHP Admin_DA::addTracker使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Admin_DA
的用法示例。
在下文中一共展示了Admin_DA::addTracker方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testDuplicateTracker
function testDuplicateTracker()
{
TestEnv::startTransaction();
$trackerId = Admin_DA::addTracker(array('trackername' => 'foo', 'description' => 'bar', 'clientid' => 0, 'appendcode' => 'a'));
$this->assertTrue(is_int($trackerId));
$this->assertTrue($trackerId > 0);
$tracker1 = Admin_DA::getTracker($trackerId);
$ret = Admin_DA::duplicateTracker($trackerId);
$this->assertTrue(is_int($ret));
$this->assertTrue($ret > 0);
$tracker2 = Admin_DA::getTracker($trackerId);
$this->assertTrue(is_array($tracker2));
$this->assertTrue(count($ret));
// compare two trackers
$this->assertEqual($tracker1, $tracker2);
TestEnv::rollbackTransaction();
}
示例2: _duplicateTracker
function _duplicateTracker($aTracker, $checkUniqueNames = false)
{
$trackerId = $aTracker['tracker_id'];
unset($aTracker['tracker_id']);
if ($checkUniqueNames) {
$aTrackers = Admin_DA::getTrackers(array('advertiser_id' => $aTracker['advertiser_id']));
Admin_DA::_getUniqueName($aTracker, $aTrackers, @$GLOBALS['strCopy']);
}
// Massage to real field names
Admin_DA::_switch($aTracker, 'advertiser_id', 'clientid');
Admin_DA::_switch($aTracker, 'name', 'trackername');
$newTrackerId = Admin_DA::addTracker($aTracker);
if (PEAR::isError($newTrackerId)) {
return PEAR::raiseError('failed to add tracker in ' . __FILE__ . ',' . __LINE__);
}
$aPlacementTrackers = Admin_DA::getPlacementTrackers(array('tracker_id' => $trackerId));
foreach ($aPlacementTrackers as $aPlacementTracker) {
$aPlacementTracker['tracker_id'] = $newTrackerId;
Admin_DA::duplicatePlacementTracker($aPlacementTracker);
}
$aVariables = Admin_DA::getVariables(array('tracker_id' => $trackerId));
foreach ($aVariables as $aVariable) {
$aVariable['tracker_id'] = $newTrackerId;
Admin_DA::duplicateVariable($aVariable);
}
return $newTrackerId;
}