예제 #1
0
 public function __construct(ProjectModel $project)
 {
     $this->slug = (string) $project->getSlug();
     $this->name = (string) $project->getName();
     $this->defaultLocale = (string) $project->getDefaultLocale();
     $this->description = (string) $project->getDescription();
 }
예제 #2
0
 public function __construct(Project $project)
 {
     $this->project = $project;
     $this->name = (string) $project->getName();
     $this->defaultLocale = (string) $project->getDefaultLocale();
     $this->description = (string) $project->getDescription();
 }
 private function getLanguagesBag(Project $project)
 {
     $slug = (string) $project->getSlug();
     if (!isset($this->languages[$slug])) {
         $this->languages[$slug] = new ArrayCollection();
     }
     return $this->languages[$slug];
 }
예제 #4
0
 private function ensureProjectDefaultLocale(Project $project)
 {
     $defaultLocale = $project->getDefaultLocale();
     $locale = $this->languageRepository->findOneByProject($project, $defaultLocale);
     if (null === $locale) {
         $language = $this->languageRepository->createNew($project, $defaultLocale);
         $this->languageRepository->save($language);
     }
 }