コード例 #1
0
 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()));
 }
コード例 #2
0
 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;
 }
コード例 #3
0
 function testAspectRatio()
 {
     $tireSize = new Elite_Vaftire_Model_TireSize(null, 55, null);
     $this->assertEquals(55, $tireSize->aspectRatio(), 'tire size has an aspect ratio');
 }