Download the PHP package ecommit/doctrine-entities-generator-bundle without Composer

On this page you can find all versions of the php package ecommit/doctrine-entities-generator-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package doctrine-entities-generator-bundle

EcommitDoctrineEntitiesGeneratorBundle

The EcommitDoctrineEntitiesGeneratorBundle bundle (for Symfony) allows the user to re(generate) getters-setters methods for Doctrine ORM entities.

Tests

Installation

Install the bundle with Composer : In your project directory, execute the following command :

Enable the bundle in the config/bundles.php file for your project :

Usage

Add the start tag to your entity :

WARNING : The content between this start tag and the end of the PHP class will be deleted when the bundle generates the getters-setters methods. The getters-setters methods will be generated between these two tags.

For example:

You can change the start tag and the end tag (the end of the PHP class by default) : See the "FAQ" section.

In your project directory, execute the following command :

For example:

Each slash is replaced by an anti-slash.

You can use the * joker (which generates multiple entities). For example:

The bundle generates getters-setters methods for an entity only if :

The bundle generates getters-setters methods for an entity property only if :

FAQ

How can I change the generated code ?

When the code is generated, the @EcommitDoctrineEntitiesGenerator/Theme/base.php.twig Twig template is used.

You can create a custom template (that extends the base template).

Solution 1 - Override the bundle

See https://symfony.com/doc/current/bundles/override.html

Solution 2 - Configure the template

In your project configuration, you can configure the theme used by the bundle. For example, you can create the config/packages/dev/ecommit_doctrine_entities_generator.yaml file:

Solution 3 - Create a custom template in entity

You can override the theme to be used by the bundle only for an entity. To do this, use the Ecommit\DoctrineEntitiesGeneratorBundle\Attribute\GenerateEntityTemplate attribute:

How can I change the start-end tags ?

You can change the template (see previous question).

The start tag is defined in the start_tag Twig block.

The end tag is defined in the end_tag Twig block.

For example, you can create this theme:

and use as follows:

How can I create a constructor in my entity ?

If your entity has a TOMANY association, the bundle will create a constructor in your entity. For this reason, manually defining a constructor in your entity is not allowed.

Instead, you can use the Ecommit\DoctrineEntitiesGeneratorBundle\Entity\EntityInitializerInterface interface and its initializeEntity method.

The initializeEntity method will be automatically called in the constructor generated in this way.

An EntityInitializerInterfaceNotUsedException exception is thrown

An Ecommit\DoctrineEntitiesGeneratorBundle\Exception\EntityInitializerInterfaceNotUsedException exception is thrown if you define manually a constructor in your entity when a TOMANY association is used.

See the previous question.

A TagNotFoundException exception is thrown

The start and/or end tag was not found in your entity.

How can I ignore the generation of getters-setters methods for an entity ?

Not all entities are processed (see the "Usage" section to find out which classes can be generated).

You can ignore the generation of getters-setters methods for an entity by using the Ecommit\DoctrineEntitiesGeneratorBundle\Attribute\IgnoreGenerateEntity attribute :

How can I ignore the generation of getters-setters methods for a property ?

Not all properties are processed (see the "Usage" section to find out which properties can be generated).

Why was no method generated ?

See the last two questions.

Limitations

The bundle only works under the following conditions :

License

This bundle is available under the MIT license. See the complete license in the LICENSE file.


All versions of doctrine-entities-generator-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
ext-mbstring Version *
doctrine/collections Version ^1.0|^2.0
doctrine/doctrine-bundle Version ^1.12.3|^2.4.5
doctrine/inflector Version ^1.4|^2.0
doctrine/orm Version ^2.7
doctrine/persistence Version ^1.1|^2.0|^3.0
nikic/php-parser Version ^4.10
symfony/config Version ^5.4|^6.4|^7.0
symfony/console Version ^5.4|^6.4|^7.0
symfony/dependency-injection Version ^5.4|^6.4|^7.0
symfony/doctrine-bridge Version ^5.4.3|^6.4|^7.0
symfony/framework-bundle Version ^5.4.5|^6.4|^7.0
symfony/http-kernel Version ^5.4|^6.4|^7.0
symfony/property-info Version ^5.4|^6.4|^7.0
symfony/twig-bundle Version ^5.4|^6.4|^7.0
twig/twig Version ^2.12.0|^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ecommit/doctrine-entities-generator-bundle contains the following files

Loading the files please wait ....