buildCondition() public method

Parses the condition specification and generates the corresponding SQL expression.
public buildCondition ( string | array $condition ) : string
$condition string | array the condition specification. Please refer to [[Query::where()]] on how to specify a condition.
return string the generated SQL expression
コード例 #1
0
 /**
  * Parses the condition specification and generates the corresponding SQL expression.
  *
  * @param string|array $condition the condition specification. Please refer to [[Query::where()]] on how to specify a condition.
  * @throws \yii\base\InvalidParamException if unknown operator is used in query
  * @throws \yii\base\NotSupportedException if string conditions are used in where
  * @return string the generated SQL expression
  */
 public function buildCondition($condition)
 {
     if ($condition instanceof Param) {
         return $condition->toArray();
     }
     return parent::buildCondition($condition);
 }