createCommand() публичный Метод

Creates a DB command that can be used to execute this query.
public createCommand ( Connection $db = null ) : Command
$db Connection the DB connection used to create the DB command. If null, the DB connection returned by [[modelClass]] will be used.
Результат Command the created DB command instance.
 /**
  * Creates a DB command that can be used to execute this query.
  * @param Connection $db the database connection used to execute the query.
  * If this parameter is not given, the `elasticsearch` application component will be used.
  * @return Command the created DB command instance.
  */
 public function createCommand($db = null)
 {
     $command = parent::createCommand($db);
     if ($this->indicesBoost !== null) {
         $command->queryParts['indices_boost'] = $this->indicesBoost;
     }
     return $command;
 }