yii2 - find records with inner join which have foreign key table value

yii2
voted: 0
vote
yii2 active-record-query

tables: expression -------------- id, expression expression_type ---------------------- id, name Find all records from expression table with expression_type name 'math'

<?php $expressions = ArrayHelper::map(\app\models\Expression::find()->innerJoin('expression_type', 'expression_type.id = expression.expression_type_id')->where(['expression_type.name' => 'math'])->orderBy('name')->all(), 'id', 'name') ?>
working url: not entered
version: not entered
Leave a Comment:
Characters left:
No comments yet.