deleteFileById() public method

Delete file by id
public deleteFileById ( string | MongoId $id ) : GridFS
$id string | MongoId id of file's document
return GridFS
Example #1
0
 public function testDeleteById_MongoIdString()
 {
     $id = $this->gridFs->storeBytes('somebinarydata', array('meta1' => 1, 'meta2' => 2));
     $this->gridFs->deleteFileById((string) $id);
     $this->assertEquals(null, $this->gridFs->getFileById($id));
 }
Example #2
0
 public function delete()
 {
     $this->gridFS->deleteFileById($this->get('_id'));
 }