public function publish(GenericEvent $event)
    {
        $legacyArticle = $event->getSubject();
        $arguments = $event->getArguments();

        if ($legacyArticle instanceof \Article) {
            $entry = $this->em
                ->getRepository('Newscoop\IngestPluginBundle\Entity\Feed\Entry')
                ->findOneByArticleId($legacyArticle->getArticleNumber());
            if ($entry !== null) {
                $entry->setPublished(new \DateTime($legacyArticle->getPublishDate()));
                $this->em->persist($entry);
                $this->em->flush();
            }
        }
    }
public function publish(GenericEvent $event)
    {
        $legacyArticle = $event->getSubject();
        $arguments = $event->getArguments();

        if ($legacyArticle instanceof \Article) {
            $entry = $this->em
                ->getRepository('Newscoop\IngestPluginBundle\Entity\Feed\Entry')
                ->findOneByArticleId($legacyArticle->getArticleNumber());
            if ($entry !== null) {
                $entry->setPublished(new \DateTime($legacyArticle->getPublishDate()));
                $this->em->persist($entry);
                $this->em->flush();
            }
        }
    }
public function publish ( GenericEvent $ event ) { $ legacyArticle = $ event -> getSubject ( ) ; $ arguments = $ event -> getArguments ( ) ; if ( $ legacyArticle instanceof \ Article ) { $ entry = $ this -> em -> getRepository ( 'Newscoop\IngestPluginBundle\Entity\Feed\Entry' ) -> findOneByArticleId ( $ legacyArticle -> getArticleNumber ( ) ) ; if ( $ entry !== null ) { $ entry -> setPublished ( new \ DateTime ( $ legacyArticle -> getPublishDate ( ) ) ) ; $ this -> em -> persist ( $ entry ) ; $ this -> em -> flush ( ) ; } } }
Handles publish and published event for articles. Will update entry
published date with article published date.

@param  Newscoop\EventDispatcher\Events\GenericEvent $event
Handles publish and published event for articles . Will update entry published date with article published date .