本文整理汇总了PHP中Social::setResponseSuccess方法的典型用法代码示例。如果您正苦于以下问题:PHP Social::setResponseSuccess方法的具体用法?PHP Social::setResponseSuccess怎么用?PHP Social::setResponseSuccess使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Social
的用法示例。
在下文中一共展示了Social::setResponseSuccess方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildResponse
/**
* Converts the response in JSON format to the value object i.e Social
*
* @param json
* - response in JSON format
*
* @return Social object filled with json data
*
*/
public function buildResponse($json)
{
$slJSONObject = $this->getServiceJSONObject("social", $json);
$sl = new Social();
$sl->setStrResponse($json);
$sl->setResponseSuccess($this->isRespponseSuccess($json));
$this->buildObjectFromJSONTree($sl, $slJSONObject);
if ($slJSONObject->has("friends")) {
if ($slJSONObject->__get("friends") instanceof JSONObject) {
$friendJSONObj = $slJSONObject->__get("friends");
$friends = new Friends($sl);
$this->buildJsonFriends($friends, $friendJSONObj);
} else {
// There is an Array of attribute
$friendsJSONArray = $slJSONObject->getJSONArray("friends");
for ($i = 0; $i < count($friendsJSONArray); $i++) {
$friendJSONObj = $friendsJSONArray[$i];
$friends = new Friends($sl);
$this->buildJsonFriends($friends, $friendJSONObj);
}
}
}
if ($slJSONObject->has("profile")) {
if ($slJSONObject->__get("profile") instanceof JSONObject) {
$publicJSONObject = $slJSONObject->__get("profile");
$publicfriend = new PublicProfile($sl);
$this->buildJsonPublicProfile($publicfriend, $publicJSONObject);
} else {
// There is an Array of attribute
$profileJSONArray = $slJSONObject->getJSONArray("profile");
for ($i = 0; $i < count($profileJSONArray); $i++) {
$profileJSONObj = $profileJSONArray[$i];
$publicfriends = new PublicProfile($sl);
$this->buildJsonPublicProfile($publicfriends, $profileJSONObj);
}
}
}
if ($slJSONObject->has("me")) {
if ($slJSONObject->__get("me") instanceof JSONObject) {
$meJSONObj = $slJSONObject->__get("me");
$me = new SocialFacebookProfile($sl);
$this->buildJsonFacebookProfile($me, $meJSONObj);
}
}
if ($slJSONObject->has("facebookProfile")) {
if ($slJSONObject->__get("facebookProfile") instanceof JSONObject) {
$meJSONObj = $slJSONObject->__get("facebookProfile");
$me = new SocialFacebookProfile($sl);
$this->buildJsonFacebookProfileLink($me, $meJSONObj);
}
}
return $sl;
}