Help for integrating the Laravel package
Forum rules: Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
#4386 by BonoboMagno
06 Jul 2017, 11:26
Code: Select allYou can create a decorator like this one to push the product related data into ElasticSeach:
https://github.com/aimeos/ai-admin-jqadm/blob/master/admin/jqadm/src/Admin/JQAdm/Common/Decorator/Cache.php


pushing data is fine. make aimeos read from elastic instead of db is not :lol:

Code: Select allCan you please explain in more detail?


Let's say i want to make a unit test that create a product, and one that can search it.

In ORM i can use something like:
Code: Select alluse Products;
use Fakedb; //or something like that
/*** ***/
$product= new Product;
$product->name=$name;
/** etc **/
$product->save();


Or i can use builder pathern for something like

Code: Select all$product= new Product(array($name,$quantity,$category$,etc));
$product->save();

Or i can use factory like this:

Code: Select all$productMadeByFactory = Factory::newproduct($arrayAttribute);



How i can do this on aimeos?
How i can finde a product in ameos?

Which are the standard object that automagically enquiry the db?! :)
#4389 by aimeos
06 Jul 2017, 16:00
BonoboMagno wrote:Let's say i want to make a unit test that create a product, and one that can search it.

How i can do this on aimeos?
How i can finde a product in ameos?


Please have a look into this article:
https://aimeos.org/docs/Developers/Library/Managing_items

Here you have examples from the product manager unit tests in Aimeos:
https://github.com/aimeos/aimeos-core/blob/master/lib/mshoplib/tests/MShop/Product/Manager/StandardTest.php

If you want to use that in a Laravel controller or command:
https://aimeos.org/docs/Laravel/Extend_Aimeos