Bolt\Storage\EntityManager::getContent PHP Method

getContent() public method

Note that this method is explicitly defined here because the magic method above cannot pass dynamic variables by reference
public getContent ( string $textquery, array $parameters = [], array &$pager = [], array $whereparameters = [] ) : Content | Content[]
$textquery string
$parameters array
$pager array
$whereparameters array
return Bolt\Legacy\Content | Bolt\Legacy\Content[]
    public function getContent($textquery, $parameters = [], &$pager = [], $whereparameters = [])
    {
        return $this->legacy()->getContent($textquery, $parameters, $pager, $whereparameters);
    }

Usage Example

Example #1
0
 /**
  * Get the content records, and fallback a page if none found.
  *
  * @param string         $contentTypeSlug
  * @param array          $contentParameters
  * @param ListingOptions $options
  *
  * @return Content|false
  */
 protected function getContent($contentTypeSlug, array $contentParameters, ListingOptions $options)
 {
     $records = $this->em->getContent($contentTypeSlug, $contentParameters);
     // UGLY HACK! Remove when cutting over to the new storage layer!
     $records = empty($records) ? false : $records;
     if ($records === false && $options->getPage() !== null) {
         $contentParameters['page'] = $options->getPreviousPage();
         $records = $this->em->getContent($contentTypeSlug, $contentParameters);
     }
     return $records;
 }
All Usage Examples Of Bolt\Storage\EntityManager::getContent