O'Reilly logo

Magento 2 Developer's Guide by Branko Ajzele

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Search Criteria Interface for list filtering

Knowing how to do a proper list filtering to fetch the entities that match a certain lookup is essential for the effective use of getList services across core Magento and possibly custom-coded API's. An example is fetching the list of customers registered within the last 24 hours for the latest added product.

Let's take a look back at our app/code/Foggyline/Slider/etc/webapi.xml file, the bit where we defined the service method="getList". The service class is defined as Foggyline\Slider\Api\SlideRepositoryInterface, which is defined as a preference for the Foggyline\Slider\Model\SlideRepository class. Finally, within the SlideRepository class, we have the actual getList. Method getList is defined as ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required