Download the PHP package final-gene/doctrine-module without Composer

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

Doctrine module

This module provides some help full extension for the ZF2 doctrine module.

Installation

After composer is available in your path you are ready to install this module.

Then add FinalGene\DoctrineModule to your application config file.

Content

Entity Manager

Background

In ZF2, we retrieve our entity manager like this (example is from a factory):

The downside of this is, that you have to know which is the name of your configured manager/connection. If you deal with more than one connection or be part of a multi module project, you are not able to know which connection or entity manager belongs to your entities.

Usage

With the use of this module, the above code transforms into the following:

Now you get a entity manager depending on your loaded modules and their configuration.

If no one configures the DoctrineModule (or the manager within), an abstract factory is called which just load the default entity manager of doctrine.

Configuration

Simply configure your doctrine connections a described in DoctrineORMModule Documentation.

Repository Manager

Background

In ZF2, we retrieve our repositories like this (example is from a factory):

This has multiple downsides:

  1. changing the repositories at runtime is hard because you can't configure the behaviour of the entity manager / entity manager's getRepository method, so you have to invent a "proxy" which then has additional logic when to switch between your different repositories
  2. hard to test: to use an alternative repository you have to mock the getRepository function of the mighty entity manager
  3. hidden dependency: we don't request a dependency from the service manager but from the entity manager
  4. no easy using of a factory class to create your repository

Usage

With the use of this module, the above code transforms into the following:

Now you get a repository depending on your loaded modules and their repository manager configuration.

If no one configures the RepositoryManagerModule, an abstract factory is called which just proxies the request to doctrines entity manager getRepository function.

Configuration

Configuration Key

The configuration key is repositories. Sub-Keys are the same as in every service manager (invokables, factories, ...).

Examples

In your module class via getConfig:

or via FinalGene\RepositoryManagerModule\ModuleManager\Feature\RepositoryProviderInterface (method getRepositoryConfig)

or via config/autoload/repository-manager.global.config.php

Validators

ObjectExists

This validator will determinate wetter an object for the given parameter exists or not.

Configuration

The validator can be used and configured as any other validator. You can set the following options:

Examples

In your validators configuration:


All versions of doctrine-module with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.0
zendframework/zend-config Version ^2.5
zendframework/zend-modulemanager Version ^2.5
doctrine/doctrine-orm-module Version ^0.9.2
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 final-gene/doctrine-module contains the following files

Loading the files please wait ....