/** * @param GithubRepoData|GithubRepoDataInterface $remote * @param GithubRepo $entity * * @return bool */ public function map(GithubRepoDataInterface $remote, GithubRepo $entity) { $entity->setGithubId($remote->getGithubId()); $entity->setOwner($remote->getOwner()); $entity->setName($remote->getName()); $entity->setFullName($remote->getFullName()); $entity->setHtmlUrl($remote->getHtmlUrl()); $entity->setDescription($remote->getDescription()); $entity->setFork($remote->getFork()); $entity->setDefaultBranch($remote->getDefaultBranch()); $entity->setGithubPrivate($remote->getGithubPrivate()); $entity->setGitUrl($remote->getGitUrl()); $entity->setSshUrl($remote->getSshUrl()); $entity->setGithubCreatedAt($remote->getGithubCreatedAt()); $entity->setGithubUpdatedAt($remote->getGithubUpdatedAt()); $entity->setGithubPushedAt($remote->getGithubPushedAt()); return true; }
/** * @param Repo|GithubRepoDataInterface $repoValueObject * * @return mixed */ public function get(GithubRepoDataInterface $repoValueObject) { return $this->repository->findOneByFullName($repoValueObject->getFullName()); }
/** * @param GithubRepoDataInterface $repo * * @return \Symfony\Component\Form\FormView */ public function getNew(GithubRepoDataInterface $repo) { $form = clone $this->form; $form->get('projectName')->setData($repo->getFullName()); return $form->createView(); }