Download the PHP package addiks/symfony_rdm without Composer

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

Symfony-RDM – Helper for using the Rich Domain Model in Symfony

Build Status Build Status Scrutinizer Code Quality Code Coverage

What

The goal of this project is to enrich the doctrine2-ORM mapping capabilities so that entities do not have to be developed for doctrine anymore, but make it possible to map any object from anywhere to a database using doctrine, even if it was not developed for that purpose. It add's a lot of new ways on how data can be mapped from the database to an object (and back).

The currently implemented features are the following:

Each of these can be combined with any other, allowing for extremely dynamic ORM mapping capabilities.

How

It hooks into the events of doctrine and hydrates the marked fields with the described values. There are multiple ways of defining which mappings should be in what fields of the services: Per annotations, YAML, XML, PHP or Static PHP. YAML-Mapping is not fully implemented yet and may be removed soon.

I would suggest you to use the XML (or YAML) mapping because entities should be framework-agnostic. I personally prefer XML over YAML because with XML you at least have a schemata while with yaml you often have to guess what keys are allowed, what all the keys mean and who actually uses them. For more detauls see the linked documentations above.

Setup

To enable this functionality first install the project via composer (symfony normally comes with composer) using the following command: composer require addiks/symfony_rdm

Then register the bundle in your symfony-application. Prior to symfony-4.0 this is done in the file "app/AppKernel.php" inside the method "registerBundles". From 4.0 onwards this is done in the file "config/bundles.php". (If you know how to automate this, please let me know.)

Symfony 2.x & 3.x:

Symfony >= 4.0:

After that this bundle should work. If not create an issue here and provide as much details about the environment this is being used in, i may be able to help.

Two ways of retrieving data: safe or fast

Using this extension to extend the ORM mapping of doctrine entities can (depending on the ORM mapping configuration) introduce new database columns that doctrine would normally not know about. When loading or storing the data for these additional columns, there are two ways to interact with them:

The safe but slow method

The safe but slow way to deal with these additional database columns is to load them one by one outside of doctrine, every time an entity is hydrated and store (UPDATE / INSERT) all modified entities in the database when the doctrine entity-manager is flushed. This is safer as the faster approach because everything happens outside of doctrine's scope and changes to doctrine or other doctrine- plugins cannot interfere with the functionality of the loading and storing process. At the same time this approach is slower - often even MUCH slower - then the faster approach because now we may need to execute one extra select statement for every hydrated entity. This can have a serious performance impact! Nevertheless, this is the default approach because while being slower, it is also the safer approach.

The fast but instable way

The alternative of loading and storing all data from and to the database outside of doctrine via extra SELECT statements is to let doctrine load and store these data for us in doctrine's own mechanisms. This way the performance is (nearly) the same as if these columns were native doctrine columns, no extra SELECT, UPDATE or INSERT statements need to be executed. The problematic part of this solution is that for this to work, we need to make doctrine aware of all these additional database columns so that doctrine can handle them for us without having doctrine actually using these data during it's own hydration of the entities. These are database-columns but not entity fields. If doctrine would try to map these columns to the entity fields on it's own, it would fail because they have no corresponding entity-fields by doctrines own logic. To prevent this from happening, this approach hooks deep into doctrine's own reflection mechanisms and fakes these entitiy-fields for doctrine. From doctrines point of view, these fields on the entities actually exist even if they are fake. This construct of hooking deep within doctrine makes a lot of assumptions about the internals of doctrine. If any of these assumptions fail (because either doctrine changes them in a new version or another extension changes them) then this extension could fail to work properly! Because of this instability / uncertainty, this method is not default but opt-in. To use this method you must define a symfony service parameter called addiks_rdm.data_loader.stability and set it to fast-and-unstable.

app/config/config.yml:

After that, you should also call a setup function named symfony_rdm_composer_hook in your entry scripts (index.php, bin/console, app.php, app_dev.php, ...) after composers vendor/autoload.php was included and after the symfony kernel was created. The composer vendor/autoload.php file returnes the class-loader object, this should be passed together with the symfony kernel to the mentioned function.

Example:

This function symfony_rdm_composer_hook is declared in a file composer_hook.php in this projects root folder. Under normal circumstances, this file should always be included automatically by composer. If not, you might get an error message that this function is unknown. In this case, you might (temporarely) include that file manually:

Service-FormType

This bundle also provides an additional new form-type called "ServiceFormType" which should prove valuable in conjunction with the service-hydration-abilities of this bundle. It allows to specify a list of service-id's as choices that can be selected between in a form and the selected being set on the entity.

The future

This project may be extended with more features in the future, here are some ideas i have:


All versions of symfony_rdm with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0.0 || ^8.1.0
doctrine/orm Version 2.13.* || ^2.14
doctrine/dbal Version 2.13.* || ^2.14 || ^3.5
symfony/yaml Version ^4.2 || ^5.4 || ^6.2
symfony/framework-bundle Version ^4.2 || ^5.4 || ^6.2
psr/cache Version 1.0.* || ^2.0
doctrine/annotations Version *
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 addiks/symfony_rdm contains the following files

Loading the files please wait ....