yii\sphinx\ActiveRecord::findBySql PHP 메소드

findBySql() 공개 정적인 메소드

Note that because the SQL statement is already specified, calling additional query modification methods (such as where(), order()) on the created ActiveQuery instance will have no effect. However, calling with(), asArray() or indexBy() is still fine. Below is an example: php $customers = Article::findBySql("SELECT * FROM idx_article WHERE MATCH('development')")->all();
public static findBySql ( string $sql, array $params = [] ) : ActiveQuery
$sql string the SQL statement to be executed
$params array parameters to be bound to the SQL statement during execution.
리턴 ActiveQuery the newly created [[ActiveQuery]] instance
    public static function findBySql($sql, $params = [])
    {
        $query = static::find();
        $query->sql = $sql;
        return $query->params($params);
    }