/** * Executes a job with given payload * * @param array $payload * @return mixed */ public function execute(array $payload) { list($entityClass, $entityId) = $payload; $entity = $this->doctrine->getRepository($entityClass)->find($entityId); if (null === $entity) { return false; } return $this->exporter->cacheItem($entity); }
/** * @param array $inputOption * * @return array|\FM\IoBundle\Export\FeedType\AbstractFeedType[] * * @throws \InvalidArgumentException */ protected function getTypes(array $inputOption) { $types = $inputOption; if ([] === $types) { $types = $this->exporter->getTypes(); } else { foreach ($types as &$type) { if (false === $this->exporter->hasType($type)) { throw new \InvalidArgumentException(sprintf('%s not supported', $type)); } $type = $this->exporter->getType($type); } } return $types; }