Skip to content
This repository

Dec 15, 2011

  1. Benjamin Eberlei

    Merge branch 'MergeSymfonyUpstream'

    beberlei authored

Dec 05, 2011

  1. Robert Gründler

    [DoctrineBundle] added EntityManager to use statements in registry (I…

    …DE support)
    pulse00 authored

Nov 17, 2011

  1. Benjamin Eberlei

    Fix LICENSE

    beberlei authored
  2. Benjamin Eberlei

    Adjust namespace from Symfony\Bundle to Doctrine\Bundle

    beberlei authored

Oct 16, 2011

  1. Lukas Kahwe Smith

    cleaned up the use statements in the Registry class and RegistryInter…

    …face
    lsmith77 authored

Sep 25, 2011

  1. Lukas Kahwe Smith

    fixed getting the alias for a namespace

    lsmith77 authored
  2. Lukas Kahwe Smith

    use getObjectNamespace() in getEntityNamespace()

    lsmith77 authored

Sep 23, 2011

  1. Lukas Kahwe Smith

    added a default implementation of the ManagerRegistry integrating the…

    … container
    
    attempted to maintain BC as good as possible, but RegistryInterface::getRepository() had to be dropped from RegistryInterface. Its still part of the ManagerRegistry, so its only a BC break for people using RegistryInterface to create their own implementation
    lsmith77 authored

Jul 19, 2011

  1. Fabien Potencier

    [DoctrineBundle] renamed RegistryInterface::getEntityManagerForObject…

    …() to getEntityManagerForClass()
    fabpot authored

Jul 09, 2011

  1. Christophe Coevoet

    [DoctrineBundle] Fixed the transient test

    stof authored
  2. Christophe Coevoet

    [DoctrineBundle] Fixed the Registry::getEntityManagerForObject method

    stof authored

Jul 06, 2011

  1. Fabien Potencier

    added Registry::getEntityManagerForObject() to conveniently get the e…

    …ntity manager associated with a given Entity
    fabpot authored

Jun 08, 2011

  1. Fabien Potencier

    refactored Doctrine Bridge

     * added a RegistryInterface
    
     * changed all classes to depend on the Registry instead of a specific EntityManager
    
    This is more consistent as the validator already took the registry and this allows
    to use any entity manager in Forms.
    fabpot authored

Jun 07, 2011

  1. Fabien Potencier

    [DoctrineBundle] added Registry::getEntityManagers()

    fabpot authored
  2. Fabien Potencier

    [DoctrineBundle] added Registry::getConnections()

    fabpot authored
  3. Fabien Potencier

    [DoctrineBundle] tweaked phpdoc

    fabpot authored

Jun 06, 2011

  1. Fabien Potencier

    [DoctrineBundle] fixed typo

    fabpot authored

Jun 02, 2011

  1. Ryan Weaver

    [DoctrineBundle] Fixing error per @stloyd

    weaverryan authored
  2. Ryan Weaver

    [FrameworkBundle][DoctrineBundle] Adding a few shortcut methods

    This adds to convience methods, for two separate reasons:
    
    * Controller::getDoctrine() - this will allow method completion on the Registry class to work in IDEs, is slightly shorter, and should feel very "concrete" to beginners
    
    * Registry::getRepository() - the repository is a very convenient thing to need - this allows it to be fetched much more succintly
    
    Overall Before:
    
        $product = $this->get('doctrine')
            ->getEntityManager()
            ->getRepository('AcmeDemoBundle:Product')
            ->find($id);
    
    Overall After (with IDE method auto-completion for `getRepository`):
    
        $product = $this->getDoctrine()
            ->getRepository('AcmeDemoBundle:Product')
            ->find($id);
    weaverryan authored

May 26, 2011

  1. Fabien Potencier

    [DoctrineBundle] extracted code from Doctrine commands

    fabpot authored

May 04, 2011

  1. Fabien Potencier

    [DoctrineBundle] split Registry::getEntityManager() in two methods

    Resetting an entity manager has a lot of consequences and the developer should
    be aware of that. So, instead of implicitly reset an entity manager when it is
    closed, the developer should reset it by hand if he thinks that this is
    possible:
    
        $em = $this->get('registry')->getEntityManager();
        $em->getConnection()->beginTransaction(); // suspend auto-commit
        try {
            //... do some work
        } catch (Exception $e) {
            $em->getConnection()->rollback();
            $em->close();
    
            $this->get('registry')->resetEntityManager();
        }
    
        // you will get a new one
        $em = $this->get('registry')->getEntityManager();
    fabpot authored

May 03, 2011

  1. Fabien Potencier

    [DoctrineBundle] changed the Registry to return a new instance if the…

    … current em is closed
    
        $em = $this->get('doctrine')->getEntityManager();
    
        $em->getConnection()->beginTransaction(); // suspend auto-commit
        try {
            //... do some work
        } catch (Exception $e) {
            $em->getConnection()->rollback();
            $em->close();
    
            // get a new EM
            $em = $this->get('doctrine')->getEntityManager();
        }
    fabpot authored
  2. Fabien Potencier

    [DoctrineBundle] removed redundant check

    fabpot authored

May 02, 2011

  1. Fabien Potencier

    [DoctrineBundle] introduced a Registry class

    The Registry knows all connections and entity managers declared into a service
    container. The Registry is available via the 'doctrine' service.
    
    If can be used to get connections and entity managers by name:
    
    Before:
    
    $em = $this->get('doctrine.orm.entity_manager');
    $em = $this->get('doctrine.orm.foobar_entity_manager');
    
    After:
    
    $em = $this->get('doctrine')->getEntityManager();
    $em = $this->get('doctrine')->getEntityManager('foobar');
    
    It is better for several reasons:
    
     * we rely less on naming conventions
     * IDEs will be able to auto-complete methods
    fabpot authored
Something went wrong with that request. Please try again.