本文整理汇总了PHP中Channel::deleteTag方法的典型用法代码示例。如果您正苦于以下问题:PHP Channel::deleteTag方法的具体用法?PHP Channel::deleteTag怎么用?PHP Channel::deleteTag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Channel
的用法示例。
在下文中一共展示了Channel::deleteTag方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: deleteTag
/**
* 服务端删除用户标签
* @param type $paramArr
*/
public static function deleteTag($paramArr)
{
$options = array('apiKey' => '', 'secretKey' => '', 'tagName' => '');
if (is_array($paramArr)) {
$options = array_merge($options, $paramArr);
}
extract($options);
$channel = new Channel($apiKey, $secretKey);
$ret = $channel->deleteTag($tagName);
return $ret;
}
示例2: Channel
function test_deleteTag($tag_name)
{
$apiKey = $this->apiKey;
$secretKey = $this->secretKey;
$channel = new Channel($apiKey, $secretKey);
$ret = $channel->deleteTag($tag_name);
if (false === $ret) {
error_output('WRONG, ' . __FUNCTION__ . ' ERROR!!!!!');
error_output('ERROR NUMBER: ' . $channel->errno());
error_output('ERROR MESSAGE: ' . $channel->errmsg());
error_output('REQUEST ID: ' . $channel->getRequestId());
} else {
right_output('SUCC, ' . __FUNCTION__ . ' OK!!!!!');
right_output('result: ' . print_r($ret, true));
}
}
示例3: setTagWithPrefix
/**
* 设定用户的推送时间,使用TAG来标记,默认0-24 意味着全天可接受
* @param string $p_buserid 用户推送ID,百度里是buserid
* @param bool $ispushallowed 是否接受推送
* @param integer $pushhourstart 推送开始时间0-23
* @param integer $pushhourend 推送结束时间1-24
*/
public static function setTagWithPrefix($p_buserid, $p_tags = array(), $p_prefix = null)
{
$rets = array();
$channel = new Channel(W2PUSH::$API_KEY, W2PUSH::$SECRET_KEY);
if (isset($p_prefix) && strlen($p_prefix) > 0) {
$tagsList = $channel->queryUserTags($p_buserid);
$optional[Channel::USER_ID] = $p_buserid;
if (is_array($tagsList) && array_key_exists('response_params', $tagsList) && array_key_exists('tags', $tagsList['response_params'])) {
foreach ($tagsList['response_params']['tags'] as $tag) {
if (strpos($tag['name'], $p_prefix) === 0) {
$ret = $channel->deleteTag($tag['name'], $optional);
if (false === $ret) {
$rets[] = array('WRONG' => __FUNCTION__ . ' ERROR!!!!', 'ERROR NUMBER' => $channel->errno(), 'ERROR MESSAGE' => $channel->errmsg(), 'REQUEST ID' => $channel->getRequestId());
} else {
$rets[] = array('SUCC' => __FUNCTION__ . ' OK!!!!!', 'result' => print_r($ret, true));
}
}
}
}
}
$countSucc = 0;
$countWrong = 0;
if (isset($p_tags)) {
$p_tags = is_array($p_tags) ? $p_tags : explode(',', $p_tags);
foreach ($p_tags as $tarName) {
$ret = $channel->setTag($tarName, $optional);
if (false === $ret) {
$countWrong++;
$rets[] = array('WRONG' => __FUNCTION__ . ' ERROR!!!!', 'ERROR NUMBER' => $channel->errno(), 'ERROR MESSAGE' => $channel->errmsg(), 'REQUEST ID' => $channel->getRequestId());
} else {
$countSucc++;
$rets[] = array('SUCC' => __FUNCTION__ . ' OK!!!!!', 'result' => print_r($ret, true));
}
}
}
return array('countSucc' => $countSucc, 'countWrong' => $countWrong, 'rets' => $rets);
}