setName($this->_getClassName()) ->setExtendedClass($this->_getClassName(true)) ->setDocBlock( new Generator\DocBlockGenerator( null, null, array( array( 'name' => 'method', 'description' => (($this->_useNamespace) ? '\\' . $this->_getNameSpace() . '\\' : '') . $this->_getClassName(false, 'Obj') . ' _getDataObj', ), array( 'name' => 'property', 'description' => (($this->_useNamespace) ? '\\' : '') . 'Qs_Doc $doc', ), ) ) ) ->addProperties(array( new Generator\PropertyGenerator( '_actions', array('list', 'view'), Generator\AbstractMemberGenerator::FLAG_PROTECTED ) )) ->addMethods( array( new MethodGenerator( '_init', array(), Generator\AbstractMemberGenerator::FLAG_PROTECTED, 'parent::_init();' . self::LINE_FEED . 'if (!empty($this->_restAlias) && is_numeric($this->_restAlias)) {' . self::LINE_FEED . ' $this->_defaultAction = \'view\';' . self::LINE_FEED . ' $this->_getDataObj()->setPrimaryKey($this->_restAlias);' . self::LINE_FEED . '}' . self::LINE_FEED . 'return $this;' ) ) ); return $this->_generateContext($classGenerator); } }