MongoGridFS::delete PHP Méthode

delete() public méthode

Delete a file from the database
public delete ( mixed $id ) : boolean
$id mixed _id of the file to remove
Résultat boolean Returns true if the remove was successfully sent to the database.
    public function delete($id)
    {
        $this->createChunksIndex();
        $this->chunks->remove(['files_id' => $id], ['justOne' => false]);
        return parent::remove(['_id' => $id]);
    }

Usage Example

 /**
  * delete.
  */
 public function delete($id)
 {
     $this->time->start();
     $return = parent::delete($id);
     $time = $this->time->stop();
     $this->log(array('type' => 'delete', 'id' => $id, 'time' => $time));
     return $return;
 }
All Usage Examples Of MongoGridFS::delete