/**
  * @param FeedTypeInterface $type
  *
  * @return FeedWriter
  */
 public function createWriter(FeedTypeInterface $type)
 {
     return new FeedWriter($this->templating, $type->getRootNode(), $type->getItemNode());
 }
Esempio n. 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()];
 }