setName($this->_getClassName()) ->setExtendedClass($this->_getClassName(true)) ->setDocBlock( new Generator\DocBlockGenerator( null, null, [ [ 'name' => 'method', 'description' => (($this->_useNamespace) ? '\\' . $this->_getNameSpace() . '\\' : '') . $this->_getClassName(false, 'Obj') . ' _getDataObj', ], [ 'name' => 'property', 'description' => (($this->_useNamespace) ? '\\' : '') . 'Qs_Doc $doc', ], ] ) ) ->addProperties([ new Generator\PropertyGenerator( '_actions', ['list', 'view'], Generator\AbstractMemberGenerator::FLAG_PROTECTED ), ]) ->addMethods( [ new MethodGenerator( '_init', [], 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); } }