protected function _buildClass()
    {
        $defineData = $this->_extractData($this->elements);

        $defineParam = $this->parameters;
        $defineProps = $this->properties;

        $docBlock = '';
        foreach ($defineData as $key => $element) {
            $type = $element['type'];
            if ('scalar' === $type) {
                $type = 'string';
            }

            $docBlock .= "\n * @property ".$type.' $'.$key.' '.(isset($element['options']['label']) ? $element['options']['label'] : '');
        }

        array_walk($defineData, function (&$value, $key) {
                    $value = "->defineData('".$key."', '".$value['type']."', ".var_export($value['options'], true).")";
                });
        array_walk($defineParam, function (&$value, $key) {
                    $value = "->defineParam('".$key."', ".var_export($value, true).")";
                });
        array_walk($defineProps, function (&$value, $key) {
                    $value = "->defineProperty('".$key."', ".var_export($value, true).")";
                });

        $phpCode = str_replace(array('<namespace>',
            '<classname>',
            '<repository>',
            '<extends>',
            '<interface>',
            '<trait>',
            '<defineDatas>',
            '<defineParam>',
            '<defineProps>',
            '<docblock>', ), array($this->namespace,
            $this->classname,
            $this->repository,
            $this->extends,
            $this->interfaces,
            $this->traits,
            (0 < count($defineData)) ? '$this'.implode('', $defineData).';' : '',
            (0 < count($defineParam)) ? '$this'.implode('', $defineParam).';' : '',
            (0 < count($defineProps)) ? '$this'.implode('', $defineProps).';' : '',
            $docBlock, ), $this->template);

        return $phpCode;
    }