You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create two classes. In the second add field with name "myFirstObject", of type "href" and configure it to allow object of the other class.
Create with each class one object in the backed. Lets say object of the first class will get ID 1 and class 2 will get object with ID 2. On object #2 put a href to Object #1.
Create custom class "MyCustomFirstClass" which will extend the first class created from the PIMCore Backend.
Setup DI in /website/config/di.php for the custom class to replace the first one.
And check out what happens with that:
Steps to reproduce
Create two classes. In the second add field with name "myFirstObject", of type "href" and configure it to allow object of the other class.
Create with each class one object in the backed. Lets say object of the first class will get ID 1 and class 2 will get object with ID 2. On object #2 put a href to Object #1.
Create custom class "MyCustomFirstClass" which will extend the first class created from the PIMCore Backend.
Setup DI in /website/config/di.php for the custom class to replace the first one.
And check out what happens with that:
Code example
$o2 = \Pimcore\Model\Object\MySecondClass::getById(2);
$o1 = $o2->getMyFirstObject();
var_dump(get_class($o1));
var_dump(get_class(\Pimcore::getDiContainer()->make(\Pimcore\Model\Object\MyFirstClass::class)));
The text was updated successfully, but these errors were encountered: