Public Member Functions | |
map () |
Definition at line 35 of file Column.php.
map | ( | ) |
Implements Varien_Convert_Mapper_Interface.
Definition at line 37 of file Column.php.
00038 { 00039 $data = $this->getData(); 00040 $this->validateDataGrid($data); 00041 if ($this->getVars() && is_array($this->getVars())) { 00042 $attributesToSelect = $this->getVars(); 00043 } else { 00044 $attributesToSelect = array(); 00045 } 00046 $onlySpecified = (bool)$this->getVar('_only_specified')===true; 00047 $mappedData = array(); 00048 foreach ($data as $i=>$row) { 00049 $newRow = array(); 00050 foreach ($row as $field=>$value) { 00051 if(!$onlySpecified || $onlySpecified && isset($attributesToSelect[$field])) { 00052 $newRow[$this->getVar($field, $field)] = $value; 00053 } 00054 } 00055 $mappedData[$i] = $newRow; 00056 } 00057 $this->setData($mappedData); 00058 return $this; 00059 }