Download the PHP package weavora/doctrine-extensions without Composer

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

Doctrine2 Extensions Build Status

Total Downloads Latest Stable Version

This library extends Doctrine2 base classes with some useful things.

Installation

This library may be installed using Composer or by cloning it from its GitHub repository. These options are described below.

Composer

You can read more about Composer and its main repository on http://packagist.org. To install these doctrine extensions using Composer, first install Composer for your project using the instructions on the Packagist home page. You can then define your development dependency on doctrine-extensions using the parameters suggested below. While every effort is made to keep the master branch stable, you may prefer to use the current stable version tag instead.

{
    "require-dev": {
        "weavora/doctrine-extensions": "dev-master@dev"
    }
}

To install, you may call:

composer.phar install

Git / GitHub

The git repository hosts the development version in its master branch. You can install it using Composer by referencing dev-master as your preferred version in your project's composer.json file as the previous example shows.

You may also install this development version:

git clone git://github.com/weavora/doctrine-extensions.git
cd doctrine-extensions

The above processes will install library to the doctrine-extensions folder.

ORM Extensions

Doctrine advices to use entity repositories that will contain business logic related to entities retrieval. Most probably, you will use a query builder inside the repository to build DQL. The issue is that a standard query builder has quite general API and doesn't provide such useful shortcuts like named scopes, a single method to apply custom criteria with parameters, etc.

This library is intended to fix what's missing and make your life a little bit easier.

How to organize repositories

Let's say you want to create a blog application. You'll probably create a post entity which will have references to the category, author and comments. And now you're thinking about an approach to organize your repositories.

Common issues with repositories:

You can solve the first issue with a custom query builder per entity. It will also hide your criteria details from the repository that doesn't really need to know that.

To solve the issue with huge and not very descriptive methods, you'll create an extension for the query builder with some helpful shortcuts to make code more readable.

An example of how PostQueryBuilder & PostRepository could look like:

Quite simple, right?

API / EntityQueryBuilder

getEntityAlias() : string | Get entity alias in the query

filterByColumn($columnName, $value, $strict = true) : EntityQueryBuilder | Compare a column with the specified value

filterByStatement($statement, $parameters = array()) : EntityQueryBuilder | Add a custom statement

limit($maxResults, $offset = null) : EntityQueryBuilder | Limit results

fetchAll($parameters = array()) : EntityClass[] | Fetch a result

fetchOne($parameters = array()) : EntityClass | Fetch the first result

fetchScalar($parameters = array()) : int|string|float|null | Fetch a scalar result

DBAL Extensions

There is only one small enhancement to DBAL classes - Connection::lockSafeUpdate that allows you to restart a query in case a transaction has been locked and failed. Maybe, it will be useful to show how to extend Doctrine connection class with custom methods.

How to configure

Usage example

About

Stability

It's not stable yet. Please, use it at your own risk.

Requirements

Submitting bugs and feature requests

Bugs and feature request are tracked on GitHub

Author

Weavora LLC - http://weavora.com - http://twitter.com/weavora
Also see the list of contributors who have participated in this project.

License

This library is licensed under the MIT License - see the LICENSE file for details


All versions of doctrine-extensions with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.3
doctrine/orm Version >=2.2.3,<2.4-dev
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 weavora/doctrine-extensions contains the following files

Loading the files please wait ....