The product object has the relation to category object.
protected $relations = [
'category' => ['hasOne', '\Module\Shop\Model\Category', 'cat_id'],
];
https://github.com/ThingEngineer/PHP-MySQLi-Database-Class#objects-mapping
However if i print {{ product.category.name }}
, it will print product
, not the category object, due to the __call
method of php-Mysqlidb.
So twig can't call to lazy load properties ?