ThingEngineer / PHP-MySQLi-Database-Class

Wrapper for a PHP MySQL class, which utilizes MySQLi and prepared statements.
Other
3.29k stars 1.35k forks source link

Relation properties doesn't work with twig? #977

Open dzpt opened 2 years ago

dzpt commented 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.

So twig can't call to lazy load properties ?