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(); }
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]; }
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); } }