Answer the question
In order to leave comments, you need to log in
How to select only those models in Yii2 that have more than zero hasMany elements in the relationship?
Good afternoon,
There is a Users
model
, it has a connection:
public function getVideos()
{
return $this->owner->hasMany($this->className, [$this->attribute => 'id']);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question