dsnetpl / doctrine-column-comment-bundle
Modifying doctrine metadata so that doctrine knows that columns in the database have additional information - a comment.
Installs: 13 491
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=8.1
- ext-ctype: *
- doctrine/doctrine-bundle: ^2.10
- doctrine/orm: ^2.15|^3.0
- phpdocumentor/reflection-docblock: ^5.6
Requires (Dev)
- phpstan/phpstan: ^2.1
- roave/security-advisories: dev-latest
- slevomat/coding-standard: ^7.2
- symfony/flex: ^1.22
- symfony/framework-bundle: >=5.4.0
- symfony/proxy-manager-bridge: >=5.4.0
- symplify/easy-coding-standard: ^12.5
Conflicts
README
Bundle for Symfony >= 4.4.0
Modifying doctrine metadata so that doctrine knows that columns in the database have additional information.
Install
$ composer require dsnetpl/doctrine-column-comment-bundle
If in project is not using Symfony Flex, should will be need to register a bundle:
# config/bundles.php return [ // ... Dsnetpl\DoctrineColumnCommentBundle::class => ['all' => true], ];
Using
To add automatic comment to field in datatable in database. Should be modified Entity file:
//... /** * Comment must be written in docblock * * @ORM\Column() */ private string $field; //..
The next step is create diff on database:
$ bin/console doctrine:schema:update --dump-sql
If everything is well configured, the following query should be generated:
COMMENT ON COLUMN table.field IS 'Comment must be written in docblock'