コード例 #1
0
 /**
  * @param array $objects
  * @param FacebookResponse $response
  */
 public function __construct(array $objects, FacebookResponse $response)
 {
     $this->objects = $objects;
     $this->response = $response;
     /* @var $resp \StdClass */
     $resp = $response->getResponse();
     $this->before = isset($resp->paging->cursors->before) ? $resp->paging->cursors->before : null;
     $this->after = isset($resp->paging->cursors->after) ? $resp->paging->cursors->after : null;
 }
コード例 #2
0
 /**
  * AdAccountGroup connections
  *
  * @param FacebookResponse $response
  * @param $prototype_class
  * @return Cursor
  */
 protected function getCursorByConnection(FacebookResponse $response, $prototype_class)
 {
     $result = array();
     $response_data = (array) $response->getResponse();
     if (!empty($response_data)) {
         foreach (array_shift($response_data) as $data) {
             /** @var AbstractObject $object */
             $object = new $prototype_class(null, null, $this->getApi());
             $object->setData((array) $data);
             $result[] = $object;
         }
     }
     return new Cursor($result, $response);
 }