Exemplo n.º 1
0
 /**
  * Retorna o arquivo
  * 
  * @return string|ZendT_File
  * @throws ZendT_Exception
  */
 public function getFile()
 {
     $result = '';
     if ($this->_valueDb) {
         $id = $this->_valueDb;
         if ($id instanceof ZendT_Type) {
             $id = $this->_valueDb->toPhp();
         }
         $_result = $this->_client->read('0ac618c3e7d9012b', $this->_valueDb, 'base64');
         if ($_result->success == 1) {
             if ($_result->fileId) {
                 $this->_value = new ZendT_File($_result->fileName, base64_decode($_result->fileContent), $_result->fileType, $_result->fileId);
                 $result = $this->_value;
             } else {
                 $this->_value = '';
             }
         } else {
             throw new ZendT_Exception($_result->message->message, $_result->message->code);
         }
     }
     return $result;
 }