Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nickwanhere/1a65fc47b78ba81fc4f41b9ccb02587b to your computer and use it in GitHub Desktop.
Save nickwanhere/1a65fc47b78ba81fc4f41b9ccb02587b to your computer and use it in GitHub Desktop.
Craft 3 Query Super Table in Plugin
$entry = Entry::find()
->section('acount')
->leftJoin('{{%supertableblocks}} as supertableblocks', '[[supertableblocks.ownerId]] = [[entries.id]]')
->leftJoin('{{%stc_SUPERTABLEFILED}} as stc_backstopids', '[[stc_SUPERTABLEFILED.elementId]] = [[supertableblocks.id]]')
->andWhere(['stc_SUPERTABLEFILED.field_TARGET'=>$id])
->one();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment