function addTireSize(Elite_Vaftire_Model_TireSize $tireSize)
 {
     $select = $this->getReadAdapter()->select()->from('elite_vehicle_tire')->where('leaf_id = ?', (int) $this->wrappedVehicle->getLeafValue())->where('section_width = ?', (int) $tireSize->sectionWidth())->where('aspect_ratio = ?', (int) $tireSize->aspectRatio())->where('diameter = ?', (int) $tireSize->diameter());
     $result = $select->query();
     if ($result->fetchColumn()) {
         return;
     }
     $this->getReadAdapter()->insert('elite_vehicle_tire', array('leaf_id' => (int) $this->wrappedVehicle->getLeafValue(), 'section_width' => $tireSize->sectionWidth(), 'aspect_ratio' => $tireSize->aspectRatio(), 'diameter' => $tireSize->diameter()));
 }
Example #2
0
 function vafUrl(VF_Vehicle $vehicle)
 {
     $params = http_build_query($vehicle->toValueArray());
     if ($vehicle->getLeafValue()) {
         if ('/' == $this->getRequest()->getBasePath()) {
             return '/vaf/product/list?' . $params;
         }
         return $this->getRequest()->getBasePath() . '/vaf/product/list?' . $params;
     }
     return '?' . $params;
 }
Example #3
0
 function getMappingId(VF_Vehicle $vehicle)
 {
     $schema = VF_Singleton::getInstance()->schema();
     $select = $this->getReadAdapter()->select()->from($this->getSchema()->mappingsTable(), 'id')->where($schema->getLeafLevel() . '_id = ?', $vehicle->getLeafValue())->where('entity_id = ?', $this->getId());
     return $select->query()->fetchColumn();
 }