/** * Delete a record from the database. * * @param mixed $id * @return int */ public function delete($id = null) { $wheres = $this->compileWheres(); $result = $this->collection->DeleteMany($wheres); if (1 == (int) $result->isAcknowledged()) { return $result->getDeletedCount(); } return 0; }