-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Closed
Labels
Component: CmsFixed in 2.3.xThe issue has been fixed in 2.3 release lineThe issue has been fixed in 2.3 release lineIssue: Format is not validGate 1 Failed. Automatic verification of issue format is failedGate 1 Failed. Automatic verification of issue format is failedup for grabs
Description
Description
As a Magento develop I would like to have a @api
interface to get CMS pages and blocks by identifiers and store id.
Existing API
Existing API of the CMS module provides an ability to:
- get page/block by ID (
BlockRepositoryInterface::get
,PageRepositoryInterface::get
) - search page/block by search criteria (
BlockRepositoryInterface::search
,PageRepositoryInterface::search
)
Solution
- Introduce
BlockManagementInterface
andPageManagementInterface
to provide an ability get CMS pages and blocks by identifiers and store id.
namespace Magento\Cms\Model;
/**
* @api
*/
interface BlockManagementInterface
{
/**
* Load Block data by given Block identifier.
*
* @param string $identifier
* @param int|null $storeId
* @return \Magento\Cms\Api\Data\BlockInterface
*/
public function getByIdentifier($identifier, $storeId = null);
}
namespace Magento\Cms\Model;
/**
* @api
*/
interface PageManagementInterface
{
/**
* Load Page data by given Page identifier.
*
* @param string $identifier
* @param int|null $storeId
* @return \Magento\Cms\Api\Data\PageInterface
*/
public function getByIdentifier($identifier, $storeId = null);
}
- Provide default implemetation for the new interfaces.
- If store id is NULL, use current store ID.
Note: All new @api
classes must be covered with the tests
Related issues:
ihor-sviziev, dmanners, convenient, piotrkwiecinski and SergioEscobales
Metadata
Metadata
Assignees
Labels
Component: CmsFixed in 2.3.xThe issue has been fixed in 2.3 release lineThe issue has been fixed in 2.3 release lineIssue: Format is not validGate 1 Failed. Automatic verification of issue format is failedGate 1 Failed. Automatic verification of issue format is failedup for grabs