models[$projectId])) { return $this->models[$projectId]; } foreach ($this->models as $model) { if ($model->getProject()->getId() === $projectId) { return $model; } } return null; } /** * @return ProjectBudgetStatisticModel[] */ public function getModels(): array { return $this->models; } public function getBegin(): ?\DateTime { return $this->begin; } public function getEnd(): ?\DateTime { return $this->end; } }