Delete file by id
public deleteFileById ( string | MongoId $id ) : |
||
$id | string | MongoId | id of file's document |
return |
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)); }
public function delete() { $this->gridFS->deleteFileById($this->get('_id')); }