Download the PHP package orbitale/doctrine-tools without Composer

On this page you can find all versions of the php package orbitale/doctrine-tools. 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-tools

:warning: This package is abandoned, please use Orbitale/ArrayFixture instead

Orbitale Doctrine Tools

This library is composed of multiple tools to be used with the Doctrine ORM.

Documentation

Installation

Simply install the library with Composer:

Usage

Entity Repository

There are 3 ways of using EntityRepositoryHelperTrait:

  1. In your own repositories, just extend the Orbitale's one:

  2. If you are using Symfony, you can override the default entity manager in the configuration:

  3. If you are using Doctrine "natively", you can override the default entity repository class in the Doctrine Configuration class:

This way, you can use your EntityRepository exactly like before, it just adds new cool methods!

Just take a look at the EntityRepositoryHelperTrait class to see what nice features it adds!

Doctrine Fixtures

This class is used mostly when you have to create Doctrine Fixtures, and when you want the most simple way to do it.

To use it, you must install doctrine/data-fixtures (and doctrine/doctrine-fixtures-bundle if you are using Symfony).

Here is a small example of a new fixtures class:

Using a callable to get a reference

When you have self-referencing relationships, you may need a reference of an object that may have already been persisted.

For this, first, you should set the flushEveryXIterations option to 1 (view below) to allow flushing on every iteration.

And next, you can set a callable element as the value of your object so you can interact manually with the injected object as 1st argument, and the AbstractFixture object as 2nd argument.

The EntityManagerInterface is also injected as 3rd argument in case you need to do some specific requests or query through another table.

Example here:

This allows perfect synchronicity when dealing with self-referencing relations.

Methods of the AbstractFixture class that can be overriden:

This way, 2 objects are automatically persisted in the database, and they're all identified with their ID. Also, if you run the symfony app/console doctrine:fixtures:load using the --append option, the IDs will be detected in the database and will not be inserted twice, with no error so you can really use fixtures as reference datas!

Take a look at the AbstractFixture class to see what other methods you can override!


All versions of doctrine-tools with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2
doctrine/orm Version ^2.6
doctrine/persistence Version ^1.3
doctrine/instantiator Version ^1.1
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 orbitale/doctrine-tools contains the following files

Loading the files please wait ....