$model = \Model\Orm\Product::query()
->related('category') // has one relation
->related('category.products') // has many relation
->where('id', '=', 1)
->get_one();
echo count($model->category->products); // The answer is always "1"
$model = \Model\Orm\Product::query()
->related('category') // has one relation
->related('category.products') // has many relation
->where('id', '=', 1)
->from_cache(false)
->get_one();
It looks like you're new here. If you want to get involved, click one of these buttons!