function testNonRootLevel() { $originalVehicle = $this->createMMY('Honda', 'Civic'); $this->startProfiling(); $finder = new VF_Level_Finder(); $modelId = $finder->findEntityIdByTitle('model', 'Civic', $originalVehicle->getValue('make')); $modelId = $finder->findEntityIdByTitle('model', 'Civic', $originalVehicle->getValue('make')); $this->assertEquals(1, $this->getQueryCount()); }
function getValueForSelectedLevel($level) { // multi tree integration if ($fit = $this->getRequest()->getParam('fit')) { return $fit; } if (!$this->hasGETRequest() && isset($_SESSION[$level])) { return $_SESSION[$level]; } if (!$this->getRequest()->getParam($level) || 'loading' == $this->getRequest()->getParam($level)) { return false; } if ($this->isNumericRequest()) { return $this->getRequest()->getParam($level); } else { $levelStringValue = $this->getRequest()->getParam($level); $levelFinder = new VF_Level_Finder(); $parentLevel = $this->schema()->getPrevLevel($level); if ($parentLevel) { $parentValue = $this->getValueForSelectedLevel($parentLevel); } else { $parentValue = null; } return $levelFinder->findEntityIdByTitle($level, $levelStringValue, isset($parentValue) ? $parentValue : null); } return false; }