Answer the question
In order to leave comments, you need to log in
How to get all links of a model?
Actually there are several related models
public function getState0() {
return $this->hasOne(Reference::class, ['id' => 'state']);
}
public function getMain_document() {
return $this->hasOne(MainDocuments::class, ['employee_id' => 'id']);
}
$models=User::findOne(1);
$models->getRealtions();//только это я так понимаю другой метод
Answer the question
In order to leave comments, you need to log in
public function getRelByClass($class,$params) {
return $this->hasOne($class, $params);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question