2017 © Pedro Peláez
 

library laravel-doctrine

The Doctrine 2 implementation that melts with Laravel 4

image

mitchellvanw/laravel-doctrine

The Doctrine 2 implementation that melts with Laravel 4

  • Wednesday, October 21, 2015
  • by mitchellvanw
  • Repository
  • 19 Watchers
  • 201 Stars
  • 19,054 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 88 Forks
  • 57 Open issues
  • 20 Versions
  • 2 % Grown

The README.md

Doctrine 2 for Laravel (NO LONGER MAINTAINED! Try laravel-doctrine/orm instead!)

Latest Stable Version License Total Downloads, (*1)

A Doctrine 2 implementation that melts with Laravel 4., (*2)

Documentation

Begin reading the full documentation here or go to a specific chapter right away., (*3)

  1. Installation
  2. How It Works
    1. Basics
    2. Entity Manager
    3. Timestamps
    4. Soft Deleting
    5. Authentication
  3. Schemas
  4. Doctrine Configuration
    1. Metadata Configuration
    2. Annotation Reader
    3. Metadata
  5. MIT License

Caveats

At the moment Doctrine\migrations version 1.0 is still in alpha. As a result the composer install may require you to change the minimum-stability in your composer.json to dev., (*4)

If you don't want to affect the stability of the rest of the packages, you can add the following property in your composer.json:, (*5)

"prefer-stable": true, (*6)

Installation

Begin by installing the package through Composer. Edit your project's composer.json to require mitchellvanw/laravel-doctrine., (*7)

This package is still in it's early stages, but fully functional. Is it possible that the API might change slightly, no drastic changes., (*8)

"require": {
    "mitchellvanw/laravel-doctrine": "0.5.*"
}

Next use Composer to update your project from the the Terminal:, (*9)

php composer.phar update

Once the package has been installed you'll need to add the service provider. Open your app/config/app.php configuration file, and add a new item to the providers array., (*10)

'Mitch\LaravelDoctrine\LaravelDoctrineServiceProvider'

After This you'll need to add the facade. Open your app/config/app.php configuration file, and add a new item to the aliases array., (*11)

'EntityManager' => 'Mitch\LaravelDoctrine\EntityManagerFacade'

It's recommended to publish the package configuration., (*12)

php artisan config:publish mitchellvanw/laravel-doctrine --path=vendor/mitchellvanw/laravel-doctrine/config

2 Minutes

This package uses the Laravel database configuration and thus it works right out of the box. With the Entity Manager facade (or service locator) you can interact with repositories. It might be wise to check out the Doctrine 2 docs to know how it works. The little example below shows how to use the EntityManager in it simplest form., (*13)

<?php

$user = new User;
$user->setName('Mitchell');

EntityManager::persist($user);
EntityManager::flush();

The User used in the example above looks like this., (*14)

<?php

use Doctrine\ORM\Mapping AS ORM;

/**
 * @ORM\Entity
 * @ORM\Table(name="users")
 */
class User
{
    /**
     * @ORM\Id
     * @ORM\GeneratedValue
     * @ORM\Column(type="integer")
     */
    private $id;

    /**
     * @ORM\Column(type="string")
     */
    private $name;

    public function getId()
    {
        return $this->id;
    }

    public function getName()
    {
        return $this->name;
    }

    public function setName($name)
    {
        $this->name = $name;
    }
}

If you've only used Eloquent and its models this might look bloated or frightening, but it's actually very simple. Let me break the class down., (*15)

<?php

use Doctrine\ORM\Mapping AS ORM;

/**
 * @ORM\Entity
 * @ORM\Table(name="users")
 */
class User
{
    /**
     * @ORM\Id
     * @ORM\GeneratedValue
     * @ORM\Column(type="integer")
     */
    private $id;

    /**
     * @ORM\Column(type="string")
     */
    private $name;
}

The only thing that's actually important in this entity are the properties. This shows you which data the entity holds., (*16)

With Doctrine 2 you can't interact with database by using the entity User. You'll have to use Entity Manager and repositories. This does create less overhead since your entities aren't extending the whole Eloquent model class. Which can dramatically slow down your application a lot if you're working with thousands or millions of records., (*17)

License

This package is licensed under the MIT license., (*18)

The Versions

21/10 2015

dev-master

9999999-dev

The Doctrine 2 implementation that melts with Laravel 4

  Sources   Download

MIT

The Requires

 

The Development Requires

orm laravel doctrine doctrine 2

19/05 2015

dev-develop

dev-develop

The Doctrine 2 implementation that melts with Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

orm laravel doctrine doctrine 2

11/02 2015

0.6.x-dev

0.6.9999999.9999999-dev

The Doctrine 2 implementation that melts with Laravel 4

  Sources   Download

MIT

The Requires

 

The Development Requires

orm laravel doctrine doctrine 2

22/09 2014

0.5.0

0.5.0.0

The Doctrine 2 implementation that melts with Laravel 4

  Sources   Download

MIT

The Requires

 

The Development Requires

orm laravel doctrine doctrine 2

16/09 2014

0.4.3

0.4.3.0

The Doctrine 2 implementation that melts with Laravel 4

  Sources   Download

MIT

The Requires

 

orm laravel doctrine doctrine 2

07/09 2014

0.4.2

0.4.2.0

The Doctrine 2 implementation that melts with Laravel 4

  Sources   Download

MIT

The Requires

 

orm laravel doctrine doctrine 2

07/09 2014

0.4.1

0.4.1.0

The Doctrine 2 implementation that melts with Laravel 4

  Sources   Download

MIT

The Requires

 

orm laravel doctrine doctrine 2

10/08 2014

0.4.0

0.4.0.0

The Doctrine 2 implementation that melts with Laravel 4

  Sources   Download

MIT

The Requires

 

orm laravel doctrine doctrine 2

13/05 2014

0.3.4

0.3.4.0

A Doctrine 2 implementation that melts with Laravel 4.

  Sources   Download

MIT

The Requires

 

orm laravel doctrine doctrine 2

11/05 2014

0.3.3

0.3.3.0

A Doctrine 2 implementation that melts with Laravel 4.

  Sources   Download

MIT

The Requires

 

orm laravel doctrine doctrine 2

10/05 2014

0.3.2

0.3.2.0

A Doctrine 2 implementation that melts with Laravel 4.

  Sources   Download

MIT

The Requires

 

orm laravel doctrine doctrine 2

09/05 2014

0.3.1

0.3.1.0

A Doctrine implementation that melts with Laravel 4.

  Sources   Download

MIT

The Requires

 

laravel doctrine

09/05 2014

0.3.0

0.3.0.0

A Doctrine implementation that melts with Laravel 4.

  Sources   Download

MIT

The Requires

 

laravel doctrine

07/05 2014

0.2.4

0.2.4.0

A Doctrine implementation that melts with Laravel 4.

  Sources   Download

MIT

The Requires

 

laravel doctrine

07/05 2014

0.2.3

0.2.3.0

A Doctrine implementation that melts with Laravel 4.

  Sources   Download

MIT

The Requires

 

laravel doctrine

07/05 2014

0.2.2

0.2.2.0

A Doctrine implementation that melts with Laravel 4.

  Sources   Download

MIT

The Requires

 

laravel doctrine

05/05 2014

0.2.1

0.2.1.0

Doctrine implementation for Laravel 4

  Sources   Download

MIT

The Requires

 

laravel doctrine

04/05 2014

0.1.2

0.1.2.0

Doctrine implementation for Laravel 4

  Sources   Download

MIT

The Requires

 

laravel doctrine

04/05 2014

0.1.1

0.1.1.0

Doctrine implementation for Laravel 4

  Sources   Download

MIT

The Requires

 

laravel doctrine

25/03 2014

0.1

0.1.0.0

Doctrine implementation for Laravel 4

  Sources   Download

MIT

The Requires

 

laravel doctrine