getFilename() public method

Returns this file's filename
public getFilename ( ) : string
return string Returns the filename
Esempio n. 1
0
 /**
  * Returns the filename
  * GetFilename wrapper of MongoGridFSFile function
  * @return string filename or False on error.
  * @since v1.3
  */
 public function getFilename()
 {
     Yii::trace('Trace: ' . __CLASS__ . '::' . __FUNCTION__ . '()', 'ext.MongoDb.EMongoGridFS');
     if (method_exists($this->_gridFSFile, 'getFilename') === true) {
         return $this->_gridFSFile->getFilename();
     } else {
         return false;
     }
 }
Esempio n. 2
0
 /**
  * Gets the filename for this file.
  *
  * @return string $filename
  */
 public function getFilename()
 {
     if ($this->isDirty && $this->filename) {
         return $this->filename;
     } elseif ($this->mongoGridFSFile instanceof \MongoGridFSFile && ($filename = $this->mongoGridFSFile->getFilename())) {
         return $filename;
     }
     return $this->filename;
 }
 public function testGetFilename()
 {
     $this->assertEquals($this->object->getFilename(), 'tests/somefile');
 }
 public function testGridFSProps()
 {
     $m = new Mongo();
     $grid = $m->foo->getGridFS();
     $x = new MongoGridFSFile($grid, array());
     $this->assertNull($x->getFilename());
     $this->assertNull($x->getSize());
 }
 protected function format_stat(MongoGridFSFile $file)
 {
     return array("name" => $file->getFilename(), "size" => $file->getSize(), "ts" => $file->file['uploadDate']->sec, "mime" => $file->file['metadata']['mime'], "read" => true, "write" => true, "width" => $file->file['metadata']['width'], "height" => $file->file['metadata']['height']);
 }
Esempio n. 6
0
 public function getFilename()
 {
     return $this->file->getFilename();
 }