Skip to content

CMS getList works not as expected #9311

@DavidLambauer

Description

@DavidLambauer

Preconditions

  1. Magento EE 2.1.5

The \Magento\Cms\Model\PageRepository::getList says it will return \Magento\Cms\Model\ResourceModel\Page\Collection but what actually comes back is \Magento\Framework\Api\SearchResults.

This is what's in the code:

/**
     * Load Page data collection by given search criteria
     *
     * @SuppressWarnings(PHPMD.CyclomaticComplexity)
     * @SuppressWarnings(PHPMD.NPathComplexity)
     * @param \Magento\Framework\Api\SearchCriteriaInterface $criteria
     * @return \Magento\Cms\Model\ResourceModel\Page\Collection
     */
    public function getList(\Magento\Framework\Api\SearchCriteriaInterface $criteria)
    {
    ... skip unnecessary parts ...

        $searchResults->setItems($pages);
        return $searchResults; // \Magento\Framework\Api\SearchResults
    }

I am not entirely sure, what I would expect. A Collection or a SearchResult is excellent but nevertheless either the doc block is not correct or the returning value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue: Format is not validGate 1 Failed. Automatic verification of issue format is failed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions