public function ccxml($projectId)
    {
        /* @var Project $project */
        $project = $this->projectStore->getById($projectId);
        $xml = new \SimpleXMLElement('<Projects/>');

        if (!$project instanceof Project || !$project->getAllowPublicStatus()) {
            return $this->renderXml($xml);
        }

        try {
            $branchList = $this->buildStore->getBuildBranches($projectId);

            if (!$branchList) {
                $branchList = array($project->getBranch());
            }

            foreach ($branchList as $branch) {
                $buildStatusService = new BuildStatusService($branch, $project, $project->getLatestBuild($branch));
                if ($attributes = $buildStatusService->toArray()) {
                    $projectXml = $xml->addChild('Project');
                    foreach ($attributes as $attributeKey => $attributeValue) {
                        $projectXml->addAttribute($attributeKey, $attributeValue);
                    }
                }
            }
        } catch (\Exception $e) {
            $xml = new \SimpleXMLElement('<projects/>');
        }

        return $this->renderXml($xml);
    }
public function ccxml($projectId)
    {
        /* @var Project $project */
        $project = $this->projectStore->getById($projectId);
        $xml = new \SimpleXMLElement('<Projects/>');

        if (!$project instanceof Project || !$project->getAllowPublicStatus()) {
            return $this->renderXml($xml);
        }

        try {
            $branchList = $this->buildStore->getBuildBranches($projectId);

            if (!$branchList) {
                $branchList = array($project->getBranch());
            }

            foreach ($branchList as $branch) {
                $buildStatusService = new BuildStatusService($branch, $project, $project->getLatestBuild($branch));
                if ($attributes = $buildStatusService->toArray()) {
                    $projectXml = $xml->addChild('Project');
                    foreach ($attributes as $attributeKey => $attributeValue) {
                        $projectXml->addAttribute($attributeKey, $attributeValue);
                    }
                }
            }
        } catch (\Exception $e) {
            $xml = new \SimpleXMLElement('<projects/>');
        }

        return $this->renderXml($xml);
    }
public function ccxml ( $ projectId ) { /* @var Project $project */ $ project = $ this -> projectStore -> getById ( $ projectId ) ; $ xml = new \ SimpleXMLElement ( '<Projects/>' ) ; if ( ! $ project instanceof Project || ! $ project -> getAllowPublicStatus ( ) ) { return $ this -> renderXml ( $ xml ) ; } try { $ branchList = $ this -> buildStore -> getBuildBranches ( $ projectId ) ; if ( ! $ branchList ) { $ branchList = array ( $ project -> getBranch ( ) ) ; } foreach ( $ branchList as $ branch ) { $ buildStatusService = new BuildStatusService ( $ branch , $ project , $ project -> getLatestBuild ( $ branch ) ) ; if ( $ attributes = $ buildStatusService -> toArray ( ) ) { $ projectXml = $ xml -> addChild ( 'Project' ) ; foreach ( $ attributes as $ attributeKey => $ attributeValue ) { $ projectXml -> addAttribute ( $ attributeKey , $ attributeValue ) ; } } } } catch ( \ Exception $ e ) { $ xml = new \ SimpleXMLElement ( '<projects/>' ) ; } return $ this -> renderXml ( $ xml ) ; }
Displays projects information in ccmenu format

@param $projectId
@return bool
@throws \Exception
@throws b8\Exception\HttpException
Displays projects information in ccmenu format