Gallery::relations PHP Method

relations() public method

public relations ( ) : array
return array relational rules.
    public function relations()
    {
        // NOTE: you may need to adjust the relation name and the related
        // class name for the relations automatically generated below.
        return ['imagesRell' => [self::HAS_MANY, 'ImageToGallery', ['gallery_id' => 'id']], 'images' => [self::HAS_MANY, 'Image', 'image_id', 'through' => 'imagesRell'], 'imagesCount' => [self::STAT, 'ImageToGallery', 'gallery_id'], 'user' => [self::BELONGS_TO, 'User', 'owner'], 'lastUpdated' => [self::STAT, 'ImageToGallery', 'gallery_id', 'select' => 'max(create_time)'], 'preview' => [self::BELONGS_TO, 'Image', 'preview_id'], 'category' => [self::BELONGS_TO, 'Category', 'category_id']];
    }