View Single Post
  #3  
Old 05-17-2018, 12:22 AM
 
Soptareanu @Alex Soptareanu @Alex is offline
 

Advanced Member
  
Join Date: Apr 2018
Posts: 39
 

Default Re: Dealing with Complex Schema API

Quote:
Originally Posted by tony_sologubov
@Alex,
You should try to implement getAllowedEntityClasses() method as follows:

Code:
protected function getAllowedEntityClasses() { $return = parent::getAllowedEntityClasses(); $return['XLite\Module\Tony\RestApiComplexSchema\Model\DemoEntity'] = 'XLite\Module\Tony\RestApiComplexSchema\Core\Schema\Complex\DemoEntity'; $return['XLite\Module\ProductVariant\Model\ProductVariant'] = 'XLite\Module\Tony\RestApiComplexSchema\Core\Schema\Complex\ProductVariant'; return $return; }

In other words, the key of return array must be name of model class and the value must be name of the class that implements the complex schema.

Please, let me know if it helps.

I tested and it works very well. Now I have another issue. Because I have very much products and productvariants, sometimes I get an 500 error because the server takes much time to respond. I want to create a tool that pull products from API in batches but for that I need instead reciving all products, get only number of rows. Is there a posibility to do that ? By default convertModel() function fetching result for each rows of entity.
__________________
Soptareanu Alex
Reply With Quote