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
{{ message }}
This repository was archived by the owner on Sep 8, 2022. It is now read-only.
We should follow best practises set out by Magento by using data models to access our blog posts.
I'm going to implement the following
Ashsmith\Blog\Api\Data\PostInterface(this already exists)Ashsmith\Blog\Api\PostRepositoryInterfaceAshsmith\Blog\Model\PostRepositoryAshsmith\Blog\Model\Data\PostThen modify
Ashsmith\Blog\Model\Postso that it no longer uses the interface, and has the methodgetDataModel.PostRepositoryInterfaceshould define the following methods:getById($postId)getList(\Magento\Framework\Api\SearchCriteriaInterface $searchCriteria)delete(\Ashsmith\Blog\Api\Data\PostInterface $post)deleteById($postId)Any reference to loading the collections, or the original Post model directly will be switched out for the PostRepository.