private function addProperty(ClassType $class, Field $field)
    {
        $property = $class->addProperty($field->getFieldName());
        $property->setVisibility('protected');
        if (!empty($field->getDescription())) {
            $property->setComment($field->getDescription());
            $property->addComment('');
        }
        $dataType = $this->getPhpDataType($field);
        $property->addComment('@var '.$dataType);
        if ($this->isCollectionType($dataType)) {
            $property->setValue([]);
        }
    }
private function addProperty(ClassType $class, Field $field)
    {
        $property = $class->addProperty($field->getFieldName());
        $property->setVisibility('protected');
        if (!empty($field->getDescription())) {
            $property->setComment($field->getDescription());
            $property->addComment('');
        }
        $dataType = $this->getPhpDataType($field);
        $property->addComment('@var '.$dataType);
        if ($this->isCollectionType($dataType)) {
            $property->setValue([]);
        }
    }
private function addProperty ( ClassType $ class , Field $ field ) { $ property = $ class -> addProperty ( $ field -> getFieldName ( ) ) ; $ property -> setVisibility ( 'protected' ) ; if ( ! empty ( $ field -> getDescription ( ) ) ) { $ property -> setComment ( $ field -> getDescription ( ) ) ; $ property -> addComment ( '' ) ; } $ dataType = $ this -> getPhpDataType ( $ field ) ; $ property -> addComment ( '@var ' . $ dataType ) ; if ( $ this -> isCollectionType ( $ dataType ) ) { $ property -> setValue ( [ ] ) ; } }
Add a property to a class.

@param ClassType $class
@param Field     $field
Add a property to a class .