public function exportFileMetaAction()
    {
        //wyszukiwanie pliku
        if (null === $files = (new Orm\CmsFileQuery)->whereName()->equals($this->name)
            ->find()) {
            throw new \Mmi\Mvc\MvcNotFoundException('File not found');
        }
        $data = [];
        //iteracja po plikach
        foreach ($files as $file) {
            //spłaszczenie meta-danych
            $file->data = ($file->data && ($file->data instanceof \Mmi\DataObject)) ? json_encode($file->data->toArray()) : null;
            $data[] = $file->toArray();
        }
        //zwrot meta
        return json_encode($data);
    }
public function exportFileMetaAction()
    {
        //wyszukiwanie pliku
        if (null === $files = (new Orm\CmsFileQuery)->whereName()->equals($this->name)
            ->find()) {
            throw new \Mmi\Mvc\MvcNotFoundException('File not found');
        }
        $data = [];
        //iteracja po plikach
        foreach ($files as $file) {
            //spłaszczenie meta-danych
            $file->data = ($file->data && ($file->data instanceof \Mmi\DataObject)) ? json_encode($file->data->toArray()) : null;
            $data[] = $file->toArray();
        }
        //zwrot meta
        return json_encode($data);
    }
public function exportFileMetaAction ( ) { //wyszukiwanie pliku if ( null === $ files = ( new Orm \ CmsFileQuery ) -> whereName ( ) -> equals ( $ this -> name ) -> find ( ) ) { throw new \ Mmi \ Mvc \ MvcNotFoundException ( 'File not found' ) ; } $ data = [ ] ; //iteracja po plikach foreach ( $ files as $ file ) { //spłaszczenie meta-danych $ file -> data = ( $ file -> data && ( $ file -> data instanceof \ Mmi \ DataObject ) ) ? json_encode ( $ file -> data -> toArray ( ) ) : null ; $ data [ ] = $ file -> toArray ( ) ; } //zwrot meta return json_encode ( $ data ) ; }
Eksportuje meta pliku
@return mixed
@throws \Mmi\Mvc\MvcNotFoundException
@throws \Mmi\Mvc\MvcForbiddenException
Eksportuje meta pliku