本文整理匯總了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());
}