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