Пример #1
0
 /**
  * @param FeedTypeInterface $type
  *
  * @return FeedWriter
  */
 public function createWriter(FeedTypeInterface $type)
 {
     return new FeedWriter($this->templating, $type->getRootNode(), $type->getItemNode());
 }
Пример #2
0
 /**
  * Returns cached instance of a FeedWriter for a specific type.
  *
  * @param FeedTypeInterface $type
  *
  * @return FeedWriter
  */
 protected function getWriter(FeedTypeInterface $type)
 {
     if (!array_key_exists($type->getName(), $this->writers)) {
         $this->writers[$type->getName()] = $this->writerFactory->createWriter($type);
     }
     return $this->writers[$type->getName()];
 }