예제 #1
0
 /**
  * @param Project $project
  *
  * @return Translations
  */
 public function addProject(Project $project)
 {
     if ($this->getProject($project->getId())) {
         throw new \InvalidArgumentException(sprintf('Project "%s" already added', $project->getId()));
     }
     $this->projects[] = $project;
     return $this;
 }
예제 #2
0
파일: Store.php 프로젝트: Appsco/translato
 public function deleteProject(Account $account, Project $project)
 {
     $dir = $this->getUserDirPath($account->getUsername());
     $filesystem = new Filesystem();
     $filesystem->remove($dir . '/' . $project->getId());
     $account->getTranslations()->removeProject($project->getId());
     $this->save($account->getUsername(), $account->getTranslations());
 }