public function testIndexByExceptionForMissingDynColumn() { $this->setExpectedException('yii\\base\\UnknownPropertyException'); $query = new DynamicActiveQuery(Product::className()); $query->select('name')->asArray()->indexBy('str'); $query->all(); }
/** * @return DynamicActiveQuery */ public function getProducts() { return $this->hasMany(Product::className(), ['supplier_id' => 'id']); }