public function createCommand($db = null) { if ($db === null) { $db = Yii::$app->getDb(); } list($sql, $params) = $db->getQueryBuilder()->build($this); return $db->createCommand($sql, $params); }
/** * Perform the DB Query * * @return array */ public function perform() { // Create the command $command = $this->query->createCommand(); // Execute the command and return return $command->queryAll(); }