Namespace issue with Express\EntryList class

Permalink
I'm trying to follow the tutorial for retrieving express entries as per this link:

https://documentation.concrete5.org/developers/express/creating-read...

However, I'm greeted with the following error message:

"Class 'Application\Controller\SinglePage\Concrete\Core\Express\EntryList' not found"

My code is as follows:

<?php  
namespace Application\Controller\SinglePage;
use PageController;
use Express;
class Search extends PageController
{
    private $cruise;
    public function view()
    {
        $entity = Express::getObjectByHandle('cruise');
        $list = new Concrete\Core\Express\EntryList($entity);
        $results = $list->getResults();
        $this->set('results', $results);
    }
}


Could anyone point me in the right direction?

Thanks

Dalecarslaw
 
Dalecarslaw replied on at Permalink Reply
Dalecarslaw
bump
mlocati replied on at Permalink Best Answer Reply
mlocati
Try adding a backslash right before Concrete\Core\Express\EntryList (otherwise the final full class name will be the one that's shown in your error message)
Dalecarslaw replied on at Permalink Reply
Dalecarslaw
yep this fixed it