コード例 #1
0
 public function testGetTypesListKeysReturnsContentOfStaticArray()
 {
     $this->assertSame($this->getStaticAttribute('\\Dkd\\PhpCmis\\Bindings\\Browser\\JSONConstants', 'TYPESLIST_KEYS'), JSONConstants::getTypesListKeys());
 }
コード例 #2
0
 /**
  * Convert given input data to a TypeChildren object
  *
  * @param array|null $data
  * @return TypeDefinitionListInterface|null Returns a TypeDefinitionListInterface object or <code>null</code>
  *      if empty data is given.
  */
 public function convertTypeChildren(array $data = null)
 {
     if (empty($data)) {
         return null;
     }
     $result = new TypeDefinitionList();
     $types = array();
     $typesList = array();
     if (isset($data[JSONConstants::JSON_TYPESLIST_TYPES])) {
         $typesList = (array) $data[JSONConstants::JSON_TYPESLIST_TYPES];
     }
     foreach ($typesList as $typeData) {
         if (is_array($typeData)) {
             $type = $this->convertTypeDefinition($typeData);
             if ($type !== null) {
                 $types[] = $type;
             }
         }
     }
     $result->setList($types);
     if (isset($data[JSONConstants::JSON_TYPESLIST_HAS_MORE_ITEMS])) {
         $result->setHasMoreItems($data[JSONConstants::JSON_TYPESLIST_HAS_MORE_ITEMS]);
     }
     if (isset($data[JSONConstants::JSON_TYPESLIST_NUM_ITEMS])) {
         $result->setNumItems($data[JSONConstants::JSON_TYPESLIST_NUM_ITEMS]);
     }
     $result->setExtensions($this->convertExtension($data, JSONConstants::getTypesListKeys()));
     return $result;
 }