/**
  * Provide heading dropdowns for creating mappings
  * @return ArrayList
  */
 public function getMapHeadings()
 {
     if (!$this->headings && !$this->mappablecols) {
         return;
     }
     $out = new Arraylist();
     foreach ($this->headings as $heading) {
         $dropdown = $this->createHeadingDropdown($heading);
         if (is_array($this->mappingvalues) && isset($this->mappingvalues[$heading])) {
             $dropdown->setValue($this->mappingvalues[$heading]);
         }
         $out->push(new ArrayData(array("Heading" => $heading, "Dropdown" => $dropdown)));
     }
     return $out;
 }
 public function ValuesForFeature($id, $pad = false)
 {
     $out = new Arraylist();
     foreach ($this->Comp() as $comp) {
         $out->push(ProductFeatureValue::get()->filter("ProductID", $comp->ID)->filter("FeatureID", $id)->first());
     }
     if ($max = Config::inst()->get('ProductComparisonPage', 'max_product_comparsions')) {
         if ($pad && $out->count() < $max) {
             for ($i = $out->count(); $i < $max; $i++) {
                 $out->push(new ArrayData(array('Padded' => true)));
             }
         }
     }
     return $out;
 }