FastFeed\FastFeed::fetch PHP Method

fetch() public method

public fetch ( string $channel = 'default' ) : Item[]
$channel string
return Item[]
    public function fetch($channel = 'default')
    {
        if (!is_string($channel)) {
            throw new LogicException('You tried to add a invalid channel.');
        }
        $items = $this->retrieve($channel);
        foreach ($this->processors as $processor) {
            $items = $processor->process($items);
        }
        return $items;
    }

Usage Example

Beispiel #1
0
 /**
  * @param string $channel
  *
  * @return array|CacheInterface
  */
 public function fetch($channel = 'default')
 {
     $items = $this->getFromCache($channel);
     if (!$items) {
         $items = parent::fetch($channel);
         $this->setToCache($channel, $items);
     }
     return $items;
 }