public function getStatusHistory() { return $this->hasMany(StatusHistory::className(), ['record_id' => 'id'])->orderBy(['stage_id' => SORT_ASC, 'created_at' => SORT_ASC]); }
/** * @return \yii\db\ActiveQuery */ public function getStatusHistory() { return $this->hasOne(StatusHistory::className(), ['id' => 'status_history_id']); }