public function deleteRows($where) { if (!is_object($where)) { if (is_string($where)) { $where = array($where); } $select = $this->select($where); } else { $select = $where; } $profiler = Kwf_Registry::get('db')->getProfiler(); $p = $profiler->queryStart($this->_collection->__toString() . "\n" . Zend_Json::encode($this->_getQuery($select))); $ret = $this->_collection->remove($this->_getQuery($select), array('safe' => true, 'multiple' => false)); $p = $profiler->queryEnd($p); if (!$ret || !$ret['ok']) { throw new Kwf_Exception("delete failed"); } }
/** * Wrapper method for MongoCollection::__toString(). * * @see http://www.php.net/manual/en/mongocollection.--tostring.php * @return string */ public function __toString() { return $this->mongoCollection->__toString(); }