Open dzpt opened 2 years ago
The product object has the relation to category object.
protected $relations = [ 'category' => ['hasOne', '\Module\Shop\Model\Category', 'cat_id'], ];
However if i print {{ product.category.name }} , it will print product , not the category object, due to the __call method of Mysqlidb.
{{ product.category.name }}
product
__call
So twig can't call to lazy load properties ?
The product object has the relation to category object.
However if i print
{{ product.category.name }}
, it will printproduct
, not the category object, due to the__call
method of Mysqlidb.So twig can't call to lazy load properties ?