字段值增长
@access public
@param string|array $field 字段名
@param integer      $step  增长值
@return $this
337591
public function inc($field, $step = 1, $op = 'inc')
    {
        $fields = is_string($field) ? explode(',', $field) : $field;

        foreach ($fields as $field => $val) {
            if (is_numeric($field)) {
                $field = $val;
            } else {
                $step = $val;
            }

            $this->data($field, ['$' . $op, $step]);
        }

        return $this;
    }
989124
public function increment(string $column, int $step = 1)
    {
        $column = $this->dialect()->quoteName($column);

        $this->addSet($column . ' = ' . $column . ' + ?', [$step]);

        return $this;
    }
495038
public function selectRandom($field): self
    {
        return $this->push('select', $this->prepareField($field))
            ->push('where', [[$this->sql('random() < 0.01'), '']]);
    }
383697
final public function decrementColumnByPk($pk, $column, $step = 1, $table = null)
    {
        return $this->db->decrement($this->getTable($table), $column, $step)
                        ->whereEquals($this->getPk(), $pk)
                        ->execute();
    }
29116
public function setStep(string $step)
    {
        $this->doSetStep($step);
        $this->getTag()->setAttribute('step', $step);

        return $this;
    }
428202
public function addStep(Step $step)
    {
        if (!$this->steps->contains($step)) {
            $this->steps->add($step);
        }

        return $this;
    }
1229705
protected function setDataType(Field & $field, $type)
    {
        $map = $this->dataTypeMap();

        if (array_key_exists($type, $map)) {
            $field->dataType = $map[$type];
        }

        return $this;
    }
1163011
function nextStep( $step )
    {
        foreach ( $this->StepTable as $key => $tableStep )
        {
            if ( $step['class'] == $tableStep['class'] )
            {
                return $this->StepTable[++$key];
            }
        }
        $retValue = null;
        return $retValue;
    }
545850
private function stepField($column, $amount)
    {
        if (!$this->DB) {
            throw  new Exception('您还没有连接数据库', Exception::CODE_DATABASE_ERROR);
        }
        if (is_array($column)) {
            if (is_array($amount) && count($amount) != count($column)) {
                throw new Exception("传递的字段与自增值无法对应，请查看数量", Exception::CODE_PARAM_NUM_ERROR);
            }
        } else {
            $column = [$column];
        }

        $sql = "update " . $this->getTable() . " set ";
        $sets = [];
        foreach ($column as $key => $val) {
            if (is_array($amount)) {
                $num = $amount[$key];
            } else {
                $num = $amount;
            }
            $val = $this->formatColumn($val);
            $sets[] = $val . " = (" . $val . " + " . $num . ") ";
        }
        $sql .= implode(',', $sets);
        $sql .= $this->buildWhere();
        $this->sql = $sql;
        /**
         * 只获取sql
         */
        if ($this->justSql) {
            return true;
        }
        $ret = $this->DB->execute($sql);

        $this->resetCon();
        return $ret;
    }
1280095
protected function normalizeFieldDefs($fields, $step)
    {
        $convertedFields = [];
        $i = 0;
        // the 'easy' yml: key = field name, value = value
        // deprecated: the 'legacy' yml: key = numerical index, value = array ( field name => value )
        foreach ($fields as $key => $field) {
            if ($key === $i && is_array($field) && count($field) == 1) {
                // each $field is one key value pair
                // eg.: $field = array($fieldIdentifier => $fieldValue)
                reset($field);
                $fieldIdentifier = key($field);
                $fieldValue = $field[$fieldIdentifier];

                $convertedFields[$fieldIdentifier] = $fieldValue;
            } else {
                $convertedFields[$key] = $field;
            }
            $i++;
        }

        // transform single-language field defs in multilang ones
        if (!$this->hasLanguageCodesAsKeys($convertedFields)) {
            $language = $this->getLanguageCode($step);

            foreach ($convertedFields as $fieldIdentifier => $fieldValue) {
                $convertedFields[$fieldIdentifier] = array($language => $fieldValue);
            }
        }

        return $convertedFields;
    }
519001
public function remove($field)
    {
        if (! is_array($field)) {
            $field = func_get_args();
        }

        foreach ($field as $f) {
            $this->update('$unset', $f, 1);
        }

        return $this;
    }
216247
final public function decrement($column, $amount = 1)
    {
        if (is_array($amount)) {
            $amount = array_map(function ($item) {
                return (0 - $item);
            }, $amount);
        } else {
            $amount = 0 - $amount;
        }
        return $this->stepField($column, $amount);
    }
1085392
public function executeStep($stepAction, &$stepActionParams, &$options, array &$context)
    {
        return $this->getConfHelper()->executeStep($stepAction, $stepActionParams, $options, $context);
    }
969729
public function where($field, $value)
    {
        if (!isset($this->_expression[$field]) || !is_array($value) || !is_array($this->_expression[$field])) {
            $this->_expression[$field] = $value;
        } else {
            $this->_expression[$field] = array_merge_recursive($this->_expression[$field], $value);
        }

        return $this;
    }
1179115
public function pushField(Field $field)
    {
        $field->setForm($this);

        $this->builder->fields()->push($field);

        return $this;
    }
1287763
public function inc($field, $step = 1, $op = 'inc')
    {
        return parent::inc($field, $step, strtolower('$' . $op));
    }
317565
public function increment(string $key, int $step = 1): int {
		return $this->driver->incrby($key, $step);
	}