Created
May 15, 2019 07:12
-
-
Save nickwanhere/1a65fc47b78ba81fc4f41b9ccb02587b to your computer and use it in GitHub Desktop.
Craft 3 Query Super Table in Plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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