/** * {@inheritdoc} */ public function startJobs(ProjectInterface $project) { $query = 'UPDATE Worldia\\Bundle\\TextmasterBundle\\Entity\\Job j ' . 'SET j.status = :status ' . 'WHERE j.projectId = :projectId '; $q = $this->entityManager->createQuery($query)->setParameter('status', JobInterface::STATUS_STARTED)->setParameter('projectId', $project->getId()); $q->execute(); $this->entityManager->clear(); }
/** * {@inheritdoc} */ public function setProject(ProjectInterface $project) { $this->project = $project; return $this->setProperty('project_id', $project->getId()); }
/** * Generate a default callback for document in review. * * @param ProjectInterface $project * * @return array */ protected function generateDocumentCallback(ProjectInterface $project) { return [DocumentInterface::STATUS_IN_REVIEW => ['url' => $this->router->generate('worldia_textmaster_callback_document', ['projectId' => $project->getId()], UrlGeneratorInterface::ABSOLUTE_URL)], DocumentInterface::STATUS_COMPLETED => ['url' => $this->router->generate('worldia_textmaster_callback_document', ['projectId' => $project->getId()], UrlGeneratorInterface::ABSOLUTE_URL)]]; }
/** * Get project language to. * * @param ProjectInterface $project * * @return string */ protected function getLanguageTo(ProjectInterface $project) { if (ProjectInterface::ACTIVITY_TRANSLATION === $project->getActivity()) { return $project->getLanguageTo(); } return $project->getLanguageFrom(); }