Wildkat-YiiExt-DoctrineOrm
[ class tree: Wildkat-YiiExt-DoctrineOrm ] [ index: Wildkat-YiiExt-DoctrineOrm ] [ all elements ]

Class: DoctrineContainer

Source Location: /Wildkat/YiiExt/DoctrineOrm/DoctrineContainer.php

Class Overview

\
   |
   --DoctrineContainer

DoctrineContainer.


Author(s):

Version:

  • Release: ##VERSION##

Variables

Methods



Class Details

[line 69]
DoctrineContainer.

This Yii application component acts as a container for the Doctrine 2 ORM library. Firstly, you will need to download the latest version of the Doctrine 2 ORM library and place it inside ext.Wildkat.YiiExt.DoctrineOrm.vendors. The directory layout should look like the following;

 DoctrineOrm/
   - vendor/
       - Doctrine/
           - Common/
           - DBAL/
           - ORM/
       - Symfony/

Now, inside main.php config file, set up the component with 3 keys (dbal, entityManager & cache) where each key represents a configuration set for each D2 component. For example;

 'components' => array(
     'doctrine' => array(
 	       'dbal' => array(
 		       [multiple dbal configurations here]
 		   ),
 		   'entityManager' => array(
 		       [multiple entity manager configurations here]
 		   ),
 		   'cache' => array(
 		       [multiple cache configurations here]
 		   ),
     ),
 )

You must also set and alias for the Wildkat namespace. At the top of the main.php configuration file, put Yii::setPathOfAlias('Wildkat', realpath(dirname(__FILE__) . '/../extensions/Wildkat'));

For each D2 component, you can specify any number of configurations and index them numerically or with a string. You can then access each configuration through the component method e.g. Yii::app()->doctrine->getConnection('foo') returns a dbal connection with a configuration index of 'foo'.




Tags:

author:  Kevin Bradwick <kevin@wildk.at>
version:  Release: ##VERSION##
link:  http://www.wildk.at
license:  New


[ Top ]


Class Variables

$cache =

[line 88]

List of cache configurations. Each with the following options

  • driver - (string) the driver e.g. ApcCache, MemcacheCache
  • namespace - (string) the cache namespace
  • servers - (array) used for memcache




Tags:

access:  public

Type:   array


[ Top ]

$dbal =

[line 77]

List of dbal configurations. Each configuration has the following options



Tags:


Type:   array


[ Top ]

$entityManager =

[line 109]

List of entity manager configurations. Each with the following options

  • connection - (string) the dbal config name
  • mappingDriver - (string) [AnnotationDriver, YamlDriver, XmlDriver]
  • mappingPaths - (array) An array of paths to find mapping information
  • mappingDriverOptions - (array) Additional mapping driver options defined in and array and make reference to each of the drivers set methods
  • metadataCache - (string) the cache configuration for metadata
  • queryCache - (string) the cache configuration for query conversions
  • resultCache - (string) the cache configuration for results
  • proxyDir - (string)the directory location for proxy classes
  • proxyNamespace - (string) the proxy namespace
  • entityNamespaces - (array) entity namespaces
  • autoGenerateProxyClasses - (bool) true false




Tags:

access:  public

Type:   array


[ Top ]



Class Methods


method getCache [line 177]

Doctrine\Common\Cache\AbstractCache getCache( [sting $name = 'default'])

Returns a cache instance. Drivers can be specified by their fully qualified name e.g. Doctrine\Common\Cache\ArrayCache or by their short name e.g. ArrayCache.

If driver class is a custom implementation, it must extend from Doctrine\Common\Cache\AbstractCache.




Tags:

throws:  CException
access:  public


Parameters:

sting   $name   the cache name

[ Top ]

method getConnection [line 143]

Doctrine\DBAL\Connection getConnection( [sting $name = 'default'])

Get an instance of a DBAL Connection



Tags:

access:  public


Parameters:

sting   $name   the connection name

[ Top ]

method getEntityManager [line 297]

Doctrine\ORM\EntityManager getEntityManager( [string $name = 'default'])

Returns an entity manager



Tags:

throws:  CException
access:  public


Parameters:

string   $name   the entity manager configuration name

[ Top ]

method init [line 126]

null init( )

Component initialization.

This method registers doctrine's autoloaders by pushing them on the current autoloader stack.




Tags:

see:  CApplicationComponent::init()
access:  public


[ Top ]


Documentation generated on Fri, 13 May 2011 14:16:00 +0100 by phpDocumentor 1.4.3