Calling unknown method: hasMany()

Viewed 67

I use the dektrium user extension, want to add the ability to upload galleries at the registration stage with https://github.com/Matvik/yii2-model-gallery. Override default RegistrationForm model and added behavior from yii2-model-gallery.

Error:

Calling unknown method: common\models\RegistrationForm::hasMany()

 * Image models relation
 * 
 * @param string $category
 * @return \matvik\modelGallery\ImageQuery
 */
public function getGalleryImages($category = null) {
    return $this->owner->hasMany(Image::class, ['item_id' => 'id'])
        ->where(['category' => ($category !== null ? $category : $this->category)])
        ->orderBy(['priority' => SORT_ASC])
        ->select([
            '*', 
            'basePath' => new Expression("'" . $this->basePath . "'"),
            'baseUrl' => new Expression("'" . $this->baseUrl . "'"),
0 Answers
Related