本文整理汇总了PHP中Style::getStyleId方法的典型用法代码示例。如果您正苦于以下问题:PHP Style::getStyleId方法的具体用法?PHP Style::getStyleId怎么用?PHP Style::getStyleId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Style
的用法示例。
在下文中一共展示了Style::getStyleId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: toJson
public function toJson()
{
if (!empty($this->raw)) {
return $this->raw;
}
$ret = array();
if ($this->type == self::TYPE_NOTIFICATION) {
$ret['title'] = $this->title;
$ret['content'] = $this->content;
$ret['accept_time'] = $this->acceptTimeToJson();
$ret['builder_id'] = $this->style->getBuilderId();
$ret['ring'] = $this->style->getRing();
$ret['vibrate'] = $this->style->getVibrate();
$ret['clearable'] = $this->style->getClearable();
$ret['n_id'] = $this->style->getNId();
if (!is_null($this->style->getRingRaw())) {
$ret['ring_raw'] = $this->style->getRingRaw();
}
$ret['lights'] = $this->style->getLights();
$ret['icon_type'] = $this->style->getIconType();
if (!is_null($this->style->getIconRes())) {
$ret['icon_res'] = $this->style->getIconRes();
}
$ret['style_id'] = $this->style->getStyleId();
if (!is_null($this->style->getSmallIcon())) {
$ret['small_icon'] = $this->style->getSmallIcon();
}
$ret['action'] = $this->action->toJson();
} else {
if ($this->type == self::TYPE_MESSAGE) {
$ret['title'] = $this->title;
$ret['content'] = $this->content;
$ret['accept_time'] = $this->acceptTimeToJson();
}
}
$ret['custom_content'] = $this->custom;
return json_encode($ret);
}
示例2: setStyle
/**
*
* @param Style $style
*/
public function setStyle(Style $style)
{
$this->setStyleID($style->getStyleId());
}