/** * @inheritdoc */ public function filter(ParameterBag $item) { /** @var FeedItemBag $item */ $item->getOriginalId(); // check if source already exists and is blocked if (null === ($source = $this->sourceManager->findSource($item->getFeed(), $item->getOriginalId()))) { return; } if ($source->isBlocked() === true) { throw new FilterException('Source is blocked'); } }
/** * {@inheritdoc} */ public function filter(ParameterBag $item) { /** @var FeedItemBag $item */ // if source does not exist yet, by all means process it if (null === ($source = $this->sourceManager->findSource($item->getFeed(), $item->getOriginalId()))) { return; } // first try modification date if (null !== ($mutationDate = $item->getDatetimeModified())) { if ($source->getDatetimeModified() > $mutationDate) { throw new FilterException('Item is not modified'); } } // item is modified or we don't have enough information to determine that, either way continue. }