/** * Return grid columns * * @param bool $withEditable Whether columns editability informations should be added to result * @return array */ public function getColumns($withEditable = false) { $columns = $this->_columns; if ($withEditable && !is_null($this->_typeModel)) { $columns = $this->_typeModel->applyEditableConfigsToColumns($this->getBlockType(), $columns, $this); } return $columns; }
/** * Return grid columns * * @param bool $withEditable Whether columns editability informations should be added to result * @param bool $withCustom Whether custom columns models should be added to corresponding columns * @return array */ public function getColumns($withEditable = false, $withCustom = false) { $columns = $this->_columns; if (!is_null($this->_typeModel)) { if ($withEditable) { $columns = $this->_typeModel->applyEditableConfigsToColumns($this->getBlockType(), $columns, $this); } if ($withCustom) { $customColumns = $this->getAvailableCustomColumns(false, true); foreach ($this->_originIds[self::GRID_COLUMN_ORIGIN_CUSTOM] as $columnId) { if (isset($customColumns[$columns[$columnId]['index']])) { $columns[$columnId]['custom_column'] = $customColumns[$columns[$columnId]['index']]; } else { $columns[$columnId]['custom_column'] = null; } } } } return $columns; }