DNRoot::getCurrentEnvironment PHP Метод

getCurrentEnvironment() публичный Метод

public getCurrentEnvironment ( DNProject $project = null ) : DNEnvironment | null
$project DNProject
Результат DNEnvironment | null
    public function getCurrentEnvironment(\DNProject $project = null)
    {
        if ($this->getRequest()->param('Environment') === null) {
            return null;
        }
        if ($project === null) {
            $project = $this->getCurrentProject();
        }
        // project can still be null
        if ($project === null) {
            return null;
        }
        return $project->DNEnvironmentList()->filter('Name', $this->getRequest()->param('Environment'))->First();
    }