Controller_Data_Mongo::incr PHP Method

incr() public method

public incr ( $m, $field, $amount )
    public function incr($m, $field, $amount)
    {
        if (!$m->loaded()) {
            throw $this->exception('Can only increment loaded model');
        }
        $m->db()->update(array($m->id_field => new MongoID($m->id)), array('$inc' => array($field => (double) $amount)));
    }