Skip to content

Instantly share code, notes, and snippets.

@marcelodeandrade
Created July 11, 2017 19:43
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save marcelodeandrade/db041055c89f85868ac198e70b0b64ac to your computer and use it in GitHub Desktop.
Save marcelodeandrade/db041055c89f85868ac198e70b0b64ac to your computer and use it in GitHub Desktop.
Yii2 mode to get raw sql from ActiveRecord
$query = Model::findAll();
echo $query->createCommand()->sql;
echo $query->createCommand()->getRawSql();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment