本文整理汇总了PHP中self::cp方法的典型用法代码示例。如果您正苦于以下问题:PHP self::cp方法的具体用法?PHP self::cp怎么用?PHP self::cp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类self
的用法示例。
在下文中一共展示了self::cp方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: parse
public static function parse($response)
{
if (!is_array($response)) {
Tag::setof($response, $response, "hash");
}
$obj = new self();
return $obj->cp($response);
}
示例2: parse
public static function parse($response)
{
if (!is_array($response)) {
$response = Text::parse_json($response);
}
$obj = new self();
return $obj->cp($response);
}
示例3: parse_list
public static function parse_list($response)
{
$result = array();
$res = Text::parse_json($response);
foreach ($res as $re) {
$obj = new self();
$result[] = $obj->cp($re);
}
return $result;
}
示例4: parse_update
public static function parse_update($response)
{
$result = array();
$re = Text::parse_json($response);
if (isset($re["error"])) {
throw new Exception($res["error"]);
}
$obj = new self();
return $obj->cp($re);
}
示例5: parse
public static function parse($response)
{
if (Tag::setof($tag, $response, "err")) {
throw new Exception($tag->inParam("msg"));
}
if (Tag::setof($tag, $response, "rsp")) {
$obj = new self();
return $obj->cp($tag->hash());
}
throw new InvalidArgumentException();
}
示例6: parse
public static function parse($response)
{
if (!is_array($response)) {
if (Tag::setof($tag, $response, "error")) {
throw new Exception($tag->value());
}
Tag::setof($tag, $response, "user");
$response = $tag->hash();
}
$obj = new self();
return $obj->cp($response);
}
示例7: parse_list
public static function parse_list($response)
{
$result = array();
if (Tag::setof($tag, $response, "info")) {
foreach ($tag->in("photo") as $photo) {
$obj = new self();
$result[] = $obj->cp($photo->hash());
}
} else {
throw new Exception("Invalid data");
}
return $result;
}
示例8: parse
public static function parse($response)
{
if (Tag::setof($tag, $response, "error")) {
throw new Exception($tag->value());
}
if (Tag::setof($tag, $response, "status")) {
$hash = $tag->hash();
$obj = new self();
$obj->user(TwitterUser::parse($hash["user"]));
unset($hash["user"]);
return $obj->cp($hash);
}
throw new Exception("invalid data");
}
示例9: parse_list
public static function parse_list($response)
{
$result = array();
if (Tag::setof($tag, $response, "error")) {
throw new Exception($tag->f("message.value()"));
}
if (Tag::setof($tag, $response, "programs")) {
foreach ($tag->in("program") as $program) {
$obj = new self();
$result[] = $obj->cp($program->hash());
}
}
return $result;
}
示例10: parse_list
public static function parse_list($response)
{
$result = array();
if (Tag::setof($tag, $response, "photos")) {
foreach ($tag->in("photo") as $photo) {
$obj = new self();
$params = array();
foreach ($photo->arParam() as $param) {
$params[$param[0]] = $param[1];
}
$result[] = $obj->cp($params);
}
}
return $result;
}
示例11: parse_list
public static function parse_list($response)
{
$result = array();
$res = Text::parse_json($response);
if (!isset($res)) {
throw new Exception($response);
}
if (isset($res["channels"])) {
foreach ($res["channels"] as $re) {
$obj = new self();
$result[] = $obj->cp($re);
}
}
return $result;
}
示例12: parse_list
public static function parse_list($response)
{
$result = array();
$res = Text::parse_json($response);
if (!isset($res)) {
throw new Exception($response);
}
foreach ($res as $re) {
$obj = new self();
$obj->user(WassrUser::parse($re["user"]));
unset($re["user"]);
$result[] = $obj->cp($re);
}
return $result;
}
示例13: parse
public static function parse($response)
{
if (Tag::setof($tag, $response, "error")) {
throw new Exception($tag->value());
}
$result = array();
if (Tag::setof($tag, $response, "direct_message")) {
$re = $status->hash();
$obj = new self();
$obj->sender(TwitterUser::parse($re["sender"]));
$obj->recipient(TwitterUser::parse($re["recipient"]));
unset($re["recipient"], $re["sender"]);
return $obj->cp($re);
}
throw new Exception("invalid data");
}
示例14: request
/**
* RequestのPaginator
* @param \ebi\Request $req
* @param integer $default_paginate_by
* @param integer $max_paginate_by
* @return \ebi\Paginator
*/
public static function request(\ebi\Request $req, $default_paginate_by = 20, $max_paginate_by = 100)
{
$paginate_by = $req->in_vars('paginate_by', $default_paginate_by);
if ($paginate_by > $max_paginate_by) {
$paginate_by = $max_paginate_by;
}
$self = new self($paginate_by, $req->in_vars('page', 1));
if ($req->is_vars('order')) {
$o = $req->in_vars('order');
$p = $req->in_vars('porder');
if ($o == $p) {
if ($o[0] == '-') {
$o = substr($o, 1);
} else {
$o = '-' . $o;
}
$req->vars('order', $o);
}
$self->order($o);
}
$self->cp($req->ar_vars());
return $self;
}