Commit 2a75cd19 by Alexander Makarov

Added missing relations to Redis/Elasticsearch test models

parent 4769e730
...@@ -35,6 +35,11 @@ class Customer extends ActiveRecord ...@@ -35,6 +35,11 @@ class Customer extends ActiveRecord
return $this->hasMany(Order::className(), ['customer_id' => 'id'])->orderBy('created_at'); return $this->hasMany(Order::className(), ['customer_id' => 'id'])->orderBy('created_at');
} }
public function getOrdersWithNullFK()
{
return $this->hasMany(OrderWithNullFK::className(), ['customer_id' => 'id'])->orderBy('created_at');
}
public function afterSave($insert) public function afterSave($insert)
{ {
ActiveRecordTest::$afterSaveInsert = $insert; ActiveRecordTest::$afterSaveInsert = $insert;
......
...@@ -28,6 +28,14 @@ class Customer extends ActiveRecord ...@@ -28,6 +28,14 @@ class Customer extends ActiveRecord
} }
/** /**
* @return \yii\redis\ActiveQuery
*/
public function getOrdersWithNullFK()
{
return $this->hasMany(OrderWithNullFK::className(), ['customer_id' => 'id']);
}
/**
* @inheritdoc * @inheritdoc
*/ */
public function afterSave($insert) public function afterSave($insert)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment