public function indexAction() { $data = $this->getEmptyResult(); $data['results'] = Application_Model_BranchPeer::getAllBranchsIncludingALL(); $this->getResponse()->setBody(json_encode($data)); $this->getResponse()->setHttpResponseCode(200); }
public function testGetAllBranchs() { $data = Application_Model_BranchPeer::getAllBranchs(); $this->assertInternalType('array', $data); $this->assertEquals(2, count($data)); for ($i = 0; $i <= 1; $i++) { $this->assertInstanceOf('Application_Model_branch', $data[$i]); $this->assertEquals($data[$i]->id, $data[$i]->name); } }
public static function getBundles($branch = 'trunk') { $bundles = array(); if ($branch == 'ALL') { $branches = Application_Model_BranchPeer::getAllBranchIds(); foreach ($branches as $singleBranch) { $bundles = array_merge($bundles, self::getBundlesForBranch($singleBranch)); } } else { $bundles = self::getBundlesForBranch($branch); } return $bundles; }