Ejemplo n.º 1
0
 function insertMappings(VF_Wheel_BoltPattern $boltPattern)
 {
     if ($boltPattern->getOffset()) {
         $q = sprintf("\n                SELECT DISTINCT(`leaf_id`) as leaf_id\n                FROM `elite_definition_wheel`\n                WHERE `bolt_distance` = %s\n                AND `lug_count` = %d\n                AND `offset` >= %s\n                AND `offset` <= %s\n                ", (double) $boltPattern->getDistance(), (double) $boltPattern->getLugCount(), (double) $boltPattern->offsetMin(), (double) $boltPattern->offsetMax());
     } else {
         $q = sprintf("\n                SELECT DISTINCT(`leaf_id`) as leaf_id\n                FROM `elite_definition_wheel`\n                WHERE `bolt_distance` = %s\n                AND `lug_count` = %d\n                ", (double) $boltPattern->getDistance(), (double) $boltPattern->getLugCount());
     }
     $result = $this->query($q);
     $years = array();
     $rows = $result->fetchAll(Zend_Db::FETCH_OBJ);
     foreach ($rows as $row) {
         $vehicle = $this->definition($row->leaf_id);
         $this->insertMapping($vehicle);
     }
 }