static function getDocumentMap($document){
        // TODO: hadi 1396-07: It is better to move this function to Collection_Document class
        $attr = new Collection_Attribute();
        $map = $attr->getList(
            array(
                'filter' => 'document=' . $document->id
            ));
        $result = array();
        $iterator = $map->getIterator();
        while ($iterator->valid()) {
            $attr = $iterator->current();
            $result[$attr->key] = $attr->value;
            $iterator->next();
        }
        
        $result['id'] = $document->id;
        $result['collection'] = $document->collection;
        return $result;
    }
static function getDocumentMap($document){
        // TODO: hadi 1396-07: It is better to move this function to Collection_Document class
        $attr = new Collection_Attribute();
        $map = $attr->getList(
            array(
                'filter' => 'document=' . $document->id
            ));
        $result = array();
        $iterator = $map->getIterator();
        while ($iterator->valid()) {
            $attr = $iterator->current();
            $result[$attr->key] = $attr->value;
            $iterator->next();
        }
        
        $result['id'] = $document->id;
        $result['collection'] = $document->collection;
        return $result;
    }
static function getDocumentMap ( $ document ) { // TODO: hadi 1396-07: It is better to move this function to Collection_Document class $ attr = new Collection_Attribute ( ) ; $ map = $ attr -> getList ( array ( 'filter' => 'document=' . $ document -> id ) ) ; $ result = array ( ) ; $ iterator = $ map -> getIterator ( ) ; while ( $ iterator -> valid ( ) ) { $ attr = $ iterator -> current ( ) ; $ result [ $ attr -> key ] = $ attr -> value ; $ iterator -> next ( ) ; } $ result [ 'id' ] = $ document -> id ; $ result [ 'collection' ] = $ document -> collection ; return $ result ; }
Gets all attributes of a document and return as map

@param $document
@return array of attributes
Gets all attributes of a document and return as map