setName($this->_getClassName()) ->addMethods( array( new MethodGenerator( '_initColumns', array(), Generator\AbstractMemberGenerator::FLAG_PROTECTED, $this->_getInitColumnsBody() ) ) ) ->setExtendedClass((($this->_useNamespace) ? $this->_moduleName . '\\' : '') . $this->_getClassName(true)); return $this->_generateContext($classGenerator, true); } protected function _getInitColumnsBody() { $body = array(); $body[] = 'parent::_initColumns();'; $body[] = '$this->addColumn(\'no\', \'no\', array(\'orderBy\' => \'sorter\'));'; $body[] = '$this->addColumn(\'image\', \'image\');'; $body[] = '$this->addColumn(\'text\', \'title\', array(\'orderBy\' => \'title\'));'; $body[] = '$this->addColumn('; $body[] = ' \'link_enum\','; $body[] = ' \'enabled\','; $body[] = ' array(\'orderBy\' => \'enabled\', \'title\' => \'Show\')'; $body[] = ');'; $body[] = '$this->addColumn(\'options\', \'options\');'; $body[] = 'return $this;'; return implode(self::LINE_FEED, $body); } }