public function convertTypeChildren(array $data = null)
    {
        if (empty($data)) {
            return null;
        }

        $result = new TypeDefinitionList();
        $types = [];

        $typesList = $data[JSONConstants::JSON_TYPESLIST_TYPES] ?? [];

        foreach (array_filter($typesList, 'is_array') as $typeData) {
            $type = $this->convertTypeDefinition($typeData);
            if ($type !== null) {
                $types[] = $type;
            }
        }

        $result->setList($types);
        $result->setHasMoreItems((boolean) ($data[JSONConstants::JSON_TYPESLIST_HAS_MORE_ITEMS] ?? false));
        $result->setNumItems($data[JSONConstants::JSON_TYPESLIST_NUM_ITEMS] ?? 0);
        $result->setExtensions($this->convertExtension($data, JSONConstants::getTypesListKeys()));

        return $result;
    }
public function convertTypeChildren(array $data = null)
    {
        if (empty($data)) {
            return null;
        }

        $result = new TypeDefinitionList();
        $types = [];

        $typesList = $data[JSONConstants::JSON_TYPESLIST_TYPES] ?? [];

        foreach (array_filter($typesList, 'is_array') as $typeData) {
            $type = $this->convertTypeDefinition($typeData);
            if ($type !== null) {
                $types[] = $type;
            }
        }

        $result->setList($types);
        $result->setHasMoreItems((boolean) ($data[JSONConstants::JSON_TYPESLIST_HAS_MORE_ITEMS] ?? false));
        $result->setNumItems($data[JSONConstants::JSON_TYPESLIST_NUM_ITEMS] ?? 0);
        $result->setExtensions($this->convertExtension($data, JSONConstants::getTypesListKeys()));

        return $result;
    }
public function convertTypeChildren ( array $ data = null ) { if ( empty ( $ data ) ) { return null ; } $ result = new TypeDefinitionList ( ) ; $ types = [ ] ; $ typesList = $ data [ JSONConstants :: JSON_TYPESLIST_TYPES ] ?? [ ] ; foreach ( array_filter ( $ typesList , 'is_array' ) as $ typeData ) { $ type = $ this -> convertTypeDefinition ( $ typeData ) ; if ( $ type !== null ) { $ types [ ] = $ type ; } } $ result -> setList ( $ types ) ; $ result -> setHasMoreItems ( ( boolean ) ( $ data [ JSONConstants :: JSON_TYPESLIST_HAS_MORE_ITEMS ] ?? false ) ) ; $ result -> setNumItems ( $ data [ JSONConstants :: JSON_TYPESLIST_NUM_ITEMS ] ?? 0 ) ; $ result -> setExtensions ( $ this -> convertExtension ( $ data , JSONConstants :: getTypesListKeys ( ) ) ) ; return $ result ; }
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.
Convert given input data to a TypeChildren object