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()));
 }
 function productIds(Elite_Vaftire_Model_TireSize $tireSize, $tireType = null)
 {
     $select = $this->getReadAdapter()->select()->from('elite_product_tire', 'distinct(entity_id) entity_id')->where('section_width = ?', $tireSize->sectionWidth())->where('aspect_ratio = ?', $tireSize->aspectRatio())->where('diameter = ?', $tireSize->diameter());
     if (!is_null($tireType)) {
         $select->where('tire_type = ?', $tireType);
     }
     $result = $select->query();
     $return = array();
     while ($row = $result->fetch()) {
         array_push($return, $row['entity_id']);
     }
     return $return;
 }
 function testSectionWidth()
 {
     $tireSize = new Elite_Vaftire_Model_TireSize(205, null, null);
     $this->assertEquals(205, $tireSize->sectionWidth(), 'tire size has a section width');
 }