Vendor/ModuleName/Model/TestModel.php
Vendor/ModuleName/Model/Data/TestModel.php
Vendor/ModuleName/Model/TestModelRepository.php
Interfaces are already created.
The Data Model contains for eg. these methods:
public function getFirstname() {};
public function getLastname() {};
the regular Model contains:
public function getName() {
return $this->getDataModel()->getFirstname() . ' ' . $this->getDataModel()->getLastname();
}
The new Magento service contracts architecture recommend to seperate entity information methods (from data model) and "action
" methods (regular model). The repository return an instance of data model, so how can i call the getName() method from regular model ? Should i create a new feactory
for the regular model and add the data model data?
Magento 2.2.6
Maybe someone has a good example for me?
lots of thanks