コード例 #1
0
 public function testGetQueryResultListKeysReturnsContentOfStaticArray()
 {
     $this->assertSame($this->getStaticAttribute('\\Dkd\\PhpCmis\\Bindings\\Browser\\JSONConstants', 'QUERYRESULTLIST_KEYS'), JSONConstants::getQueryResultListKeys());
 }
コード例 #2
0
 /**
  * Convert given input data array from query result to a ObjectList object
  *
  * @param array|null $data
  * @return null|ObjectList
  */
 public function convertQueryResultList(array $data = null)
 {
     if (empty($data)) {
         return null;
     }
     $objectList = new ObjectList();
     $objects = array();
     if (isset($data[JSONConstants::JSON_QUERYRESULTLIST_RESULTS])) {
         foreach ((array) $data[JSONConstants::JSON_QUERYRESULTLIST_RESULTS] as $objectData) {
             $object = $this->convertObject($objectData);
             if ($object !== null) {
                 $objects[] = $object;
             }
         }
     }
     $objectList->setObjects($objects);
     if (isset($data[JSONConstants::JSON_QUERYRESULTLIST_HAS_MORE_ITEMS])) {
         $objectList->setHasMoreItems((bool) $data[JSONConstants::JSON_QUERYRESULTLIST_HAS_MORE_ITEMS]);
     }
     if (isset($data[JSONConstants::JSON_QUERYRESULTLIST_NUM_ITEMS])) {
         $objectList->setNumItems((int) $data[JSONConstants::JSON_QUERYRESULTLIST_NUM_ITEMS]);
     }
     $objectList->setExtensions($this->convertExtension($data, JSONConstants::getQueryResultListKeys()));
     return $objectList;
 }