public function convertToPods($type, array $documents)
    {
        $result = array();

        foreach ($documents as $document) {

            if ($document instanceof \triagens\ArangoDb\Document) {
                $model = $this->convertDriverDocumentToPod($document);

                $result[$document->getInternalId()] = $model;

            } else {
                $model = $this->convertArrayToPod($type, $document);

                if (isset($document['_id'])) {
                    $result[$document['_id']] = $model;
                } else {
                    $result[] = $model;
                }
            }
        }

        return $result;
    }
public function convertToPods($type, array $documents)
    {
        $result = array();

        foreach ($documents as $document) {

            if ($document instanceof \triagens\ArangoDb\Document) {
                $model = $this->convertDriverDocumentToPod($document);

                $result[$document->getInternalId()] = $model;

            } else {
                $model = $this->convertArrayToPod($type, $document);

                if (isset($document['_id'])) {
                    $result[$document['_id']] = $model;
                } else {
                    $result[] = $model;
                }
            }
        }

        return $result;
    }
public function convertToPods ( $ type , array $ documents ) { $ result = array ( ) ; foreach ( $ documents as $ document ) { if ( $ document instanceof \ triagens \ ArangoDb \ Document ) { $ model = $ this -> convertDriverDocumentToPod ( $ document ) ; $ result [ $ document -> getInternalId ( ) ] = $ model ; } else { $ model = $ this -> convertArrayToPod ( $ type , $ document ) ; if ( isset ( $ document [ '_id' ] ) ) { $ result [ $ document [ '_id' ] ] = $ model ; } else { $ result [ ] = $ model ; } } } return $ result ; }
Converts an array of documents into pods. The documents in each array can be an ArangoDB-PHP document, edge or vertex or an associative array.
@param  string $type      The type the resulting pods should have.
@param  array  $documents An array of documents or associative arrays.
@return array
Converts an array of documents into pods . The documents in each array can be an ArangoDB - PHP document edge or vertex or an associative array .