Commit c763b476 authored by Benjamin Eberlei's avatar Benjamin Eberlei

Merge commit 'dc2master/master' into lock-support

parents dfbd9e6e f3c672a2
# Upgrade from 2.0-ALPHA4 to 2.0-BETA1
## Console migrated to Symfony Console
The Doctrine Cli has been replaced by Symfony Console Configuration
Instead of having to specifiy:
[php]
$cliConfig = new CliConfiguration();
$cliConfig->setAttribute('em', $entityManager);
You now have to configure the script like:
[php]
$helperSet = new \Symfony\Components\Console\Helper\HelperSet(array(
'db' => new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($em->getConnection()),
'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($em)
));
## Console: No need for Mapping Paths anymore
In previous versions you had to specify the --from and --from-path options
to show where your mapping paths are from the console. However this information
is already known from the Mapping Driver configuration, so the requirement
for this options were dropped.
Instead for each console command all the entities are loaded and to
restrict the operation to one or more sub-groups you can use the --filter flag.
## AnnotationDriver is not a default mapping driver anymore
In conjunction with the recent changes to Console we realized that the
annotations driver being a default metadata driver lead to lots of glue
code in the console components to detect where entities lie and how to load
them for batch updates like SchemaTool and other commands. However the
annotations driver being a default driver does not really help that much
anyways.
Therefore we decided to break backwards compability in this issue and drop
the support for Annotations as Default Driver and require our users to
specify the driver explicitly (which allows us to ask for the path to all
entities).
If you are using the annotations metadata driver as default driver, you
have to add the following lines to your bootstrap code:
$driverImpl = $config->newDefaultAnnotationDriver(array(__DIR__."/Entities"));
$config->setMetadataDriverImpl($driverImpl);
You have to specify the path to your entities as either string of a single
path or array of multiple paths
to your entities. This information will be used by all console commands to
access all entities.
Xml and Yaml Drivers work as before!
## New inversedBy attribute
It is now *mandatory* that the owning side of a bidirectional association specifies the
......
......@@ -410,11 +410,6 @@ abstract class AbstractQuery
throw new NonUniqueResultException;
}
return array_shift($result);
} else if (is_object($result)) {
if (count($result) > 1) {
throw new NonUniqueResultException;
}
return $result->first();
}
return $result;
......
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
......@@ -21,6 +19,9 @@
namespace Doctrine\ORM;
use Doctrine\Common\Cache\Cache,
Doctrine\ORM\Mapping\Driver\Driver;
/**
* Configuration container for all configuration options of Doctrine.
* It combines all configuration options from DBAL & ORM.
......@@ -118,15 +119,29 @@ class Configuration extends \Doctrine\DBAL\Configuration
/**
* Sets the cache driver implementation that is used for metadata caching.
*
* @param object $driverImpl
* @param Driver $driverImpl
* @todo Force parameter to be a Closure to ensure lazy evaluation
* (as soon as a metadata cache is in effect, the driver never needs to initialize).
*/
public function setMetadataDriverImpl($driverImpl)
public function setMetadataDriverImpl(Driver $driverImpl)
{
$this->_attributes['metadataDriverImpl'] = $driverImpl;
}
/**
* Add a new default annotation driver with a correctly configured annotation reader.
*
* @param array $paths
* @return Mapping\Driver\AnnotationDriver
*/
public function newDefaultAnnotationDriver($paths = array())
{
$reader = new \Doctrine\Common\Annotations\AnnotationReader();
$reader->setDefaultAnnotationNamespace('Doctrine\ORM\Mapping\\');
return new \Doctrine\ORM\Mapping\Driver\AnnotationDriver($reader, (array)$paths);
}
/**
* Adds a namespace under a certain alias.
*
......@@ -168,23 +183,18 @@ class Configuration extends \Doctrine\DBAL\Configuration
/**
* Gets the cache driver implementation that is used for the mapping metadata.
*
* @return object
* @throws ORMException
* @return Mapping\Driver\Driver
*/
public function getMetadataDriverImpl()
{
if ($this->_attributes['metadataDriverImpl'] == null) {
$reader = new \Doctrine\Common\Annotations\AnnotationReader(new \Doctrine\Common\Cache\ArrayCache);
$reader->setDefaultAnnotationNamespace('Doctrine\ORM\Mapping\\');
$this->_attributes['metadataDriverImpl'] = new \Doctrine\ORM\Mapping\Driver\AnnotationDriver($reader);
}
return $this->_attributes['metadataDriverImpl'];
}
/**
* Gets the cache driver implementation that is used for query result caching.
*
* @return object
* @return \Doctrine\Common\Cache\Cache
*/
public function getResultCacheImpl()
{
......@@ -194,9 +204,9 @@ class Configuration extends \Doctrine\DBAL\Configuration
/**
* Sets the cache driver implementation that is used for query result caching.
*
* @param object $cacheImpl
* @param \Doctrine\Common\Cache\Cache $cacheImpl
*/
public function setResultCacheImpl($cacheImpl)
public function setResultCacheImpl(Cache $cacheImpl)
{
$this->_attributes['resultCacheImpl'] = $cacheImpl;
}
......@@ -204,7 +214,7 @@ class Configuration extends \Doctrine\DBAL\Configuration
/**
* Gets the cache driver implementation that is used for the query cache (SQL cache).
*
* @return object
* @return \Doctrine\Common\Cache\Cache
*/
public function getQueryCacheImpl()
{
......@@ -214,9 +224,9 @@ class Configuration extends \Doctrine\DBAL\Configuration
/**
* Sets the cache driver implementation that is used for the query cache (SQL cache).
*
* @param object $cacheImpl
* @param \Doctrine\Common\Cache\Cache $cacheImpl
*/
public function setQueryCacheImpl($cacheImpl)
public function setQueryCacheImpl(Cache $cacheImpl)
{
$this->_attributes['queryCacheImpl'] = $cacheImpl;
}
......@@ -224,7 +234,7 @@ class Configuration extends \Doctrine\DBAL\Configuration
/**
* Gets the cache driver implementation that is used for metadata caching.
*
* @return object
* @return \Doctrine\Common\Cache\Cache
*/
public function getMetadataCacheImpl()
{
......@@ -234,9 +244,9 @@ class Configuration extends \Doctrine\DBAL\Configuration
/**
* Sets the cache driver implementation that is used for metadata caching.
*
* @param object $cacheImpl
* @param \Doctrine\Common\Cache\Cache $cacheImpl
*/
public function setMetadataCacheImpl($cacheImpl)
public function setMetadataCacheImpl(Cache $cacheImpl)
{
$this->_attributes['metadataCacheImpl'] = $cacheImpl;
}
......
......@@ -609,9 +609,11 @@ class EntityManager
* @param EventManager $eventManager The EventManager instance to use.
* @return EntityManager The created EntityManager.
*/
public static function create($conn, Configuration $config = null, EventManager $eventManager = null)
public static function create($conn, Configuration $config, EventManager $eventManager = null)
{
$config = $config ?: new Configuration();
if (!$config->getMetadataDriverImpl()) {
throw ORMException::missingMappingDriverImpl();
}
if (is_array($conn)) {
$conn = \Doctrine\DBAL\DriverManager::getConnection($conn, $config, ($eventManager ?: new EventManager()));
......
......@@ -36,7 +36,11 @@ class SingleScalarHydrator extends AbstractHydrator
{
$cache = array();
$result = $this->_stmt->fetchAll(\PDO::FETCH_ASSOC);
if (count($result) > 1 || count($result[key($result)]) > 1) {
$num = count($result);
if ($num == 0) {
throw new \Doctrine\ORM\NoResultException;
} else if ($num > 1 || count($result[key($result)]) > 1) {
throw new \Doctrine\ORM\NonUniqueResultException;
}
$result = $this->_gatherScalarRowData($result[key($result)], $cache);
......
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
......@@ -152,7 +150,23 @@ abstract class AssociationMapping
*
* @var array
*/
public $joinTable = array();
public $joinTable;
/**
* READ-ONLY: The name of the entity class from which the association was
* inherited in an inheritance hierarchy.
*
* @var string
*/
public $inherited;
/**
* READ-ONLY: The name of the entity or mapped superclass that declares
* the association field in an inheritance hierarchy.
*
* @var string
*/
public $declared;
/**
* Initializes a new instance of a class derived from AssociationMapping.
......@@ -161,9 +175,7 @@ abstract class AssociationMapping
*/
public function __construct(array $mapping)
{
if ($mapping) {
$this->_validateAndCompleteMapping($mapping);
}
$this->_validateAndCompleteMapping($mapping);
}
/**
......@@ -317,8 +329,9 @@ abstract class AssociationMapping
abstract public function load($sourceEntity, $target, $em, array $joinColumnValues = array());
/**
*
* @param $platform
* Gets the (possibly quoted) name of the join table.
*
* @param AbstractPlatform $platform
* @return string
*/
public function getQuotedJoinTableName($platform)
......
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
......@@ -72,11 +70,10 @@ class ClassMetadata extends ClassMetadataInfo
*/
public function __construct($entityName)
{
$this->name = $entityName;
$this->reflClass = new \ReflectionClass($entityName);
parent::__construct($entityName);
$this->reflClass = new ReflectionClass($entityName);
$this->namespace = $this->reflClass->getNamespaceName();
$this->table['name'] = $this->reflClass->getShortName();
$this->rootEntityName = $entityName;
}
/**
......@@ -99,18 +96,6 @@ class ClassMetadata extends ClassMetadataInfo
return $this->reflFields;
}
/**
* INTERNAL:
* Adds a reflection property. Usually only used by the ClassMetadataFactory
* while processing inheritance mappings.
*
* @param array $props
*/
public function addReflectionProperty($propName, \ReflectionProperty $property)
{
$this->reflFields[$propName] = $property;
}
/**
* Gets a ReflectionProperty for a specific field of the mapped class.
*
......@@ -189,7 +174,7 @@ class ClassMetadata extends ClassMetadataInfo
public function setIdentifierValues($entity, $id)
{
if ($this->isIdentifierComposite) {
foreach ((array)$id as $idField => $idValue) {
foreach ($id as $idField => $idValue) {
$this->reflFields[$idField]->setValue($entity, $idValue);
}
} else {
......@@ -220,18 +205,6 @@ class ClassMetadata extends ClassMetadataInfo
return $this->reflFields[$field]->getValue($entity);
}
/**
* Sets the field mapped to the specified column to the specified value on the given entity.
*
* @param object $entity
* @param string $field
* @param mixed $value
*/
public function setColumnValue($entity, $column, $value)
{
$this->reflFields[$this->fieldNames[$column]]->setValue($entity, $value);
}
/**
* Stores the association mapping.
*
......@@ -243,10 +216,10 @@ class ClassMetadata extends ClassMetadataInfo
// Store ReflectionProperty of mapped field
$sourceFieldName = $assocMapping->sourceFieldName;
$refProp = $this->reflClass->getProperty($sourceFieldName);
$refProp->setAccessible(true);
$this->reflFields[$sourceFieldName] = $refProp;
$refProp = $this->reflClass->getProperty($sourceFieldName);
$refProp->setAccessible(true);
$this->reflFields[$sourceFieldName] = $refProp;
}
/**
......@@ -314,7 +287,6 @@ class ClassMetadata extends ClassMetadataInfo
'identifier',
'idGenerator', //TODO: Does not really need to be serialized. Could be moved to runtime.
'inheritanceType',
'inheritedAssociationFields',
'isIdentifierComposite',
'isMappedSuperclass',
'isVersioned',
......@@ -337,20 +309,20 @@ class ClassMetadata extends ClassMetadataInfo
{
// Restore ReflectionClass and properties
$this->reflClass = new ReflectionClass($this->name);
foreach ($this->fieldMappings as $field => $mapping) {
if (isset($mapping['inherited'])) {
$reflField = new ReflectionProperty($mapping['inherited'], $field);
} else {
$reflField = $this->reflClass->getProperty($field);
}
if (isset($mapping['declared'])) {
$reflField = new ReflectionProperty($mapping['declared'], $field);
} else {
$reflField = $this->reflClass->getProperty($field);
}
$reflField->setAccessible(true);
$this->reflFields[$field] = $reflField;
}
foreach ($this->associationMappings as $field => $mapping) {
if (isset($this->inheritedAssociationFields[$field])) {
$reflField = new ReflectionProperty($this->inheritedAssociationFields[$field], $field);
if ($mapping->declared) {
$reflField = new ReflectionProperty($mapping->declared, $field);
} else {
$reflField = $this->reflClass->getProperty($field);
}
......
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
......@@ -30,10 +28,7 @@ use Doctrine\ORM\ORMException,
* metadata mapping informations of a class which describes how a class should be mapped
* to a relational database.
*
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision$
* @author Benjamin Eberlei <kontakt@beberlei.de>
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
......@@ -190,7 +185,25 @@ class ClassMetadataFactory
{
$this->_loadedMetadata[$className] = $class;
}
/**
* Get array of parent classes for the given entity class
*
* @param string $name
* @return array $parentClasses
*/
protected function _getParentClasses($name)
{
// Collect parent classes, ignoring transient (not-mapped) classes.
$parentClasses = array();
foreach (array_reverse(class_parents($name)) as $parentClass) {
if ( ! $this->_driver->isTransient($parentClass)) {
$parentClasses[] = $parentClass;
}
}
return $parentClasses;
}
/**
* Loads the metadata of the class in question and all it's ancestors whose metadata
* is still not loaded.
......@@ -203,19 +216,10 @@ class ClassMetadataFactory
if ( ! $this->_initialized) {
$this->_initialize();
}
$loaded = array();
// Collect parent classes, ignoring transient (not-mapped) classes.
//TODO: Evaluate whether we can use class_parents() here.
$parentClass = $name;
$parentClasses = array();
while ($parentClass = get_parent_class($parentClass)) {
if ( ! $this->_driver->isTransient($parentClass)) {
$parentClasses[] = $parentClass;
}
}
$parentClasses = array_reverse($parentClasses);
$parentClasses = $this->_getParentClasses($name);
$parentClasses[] = $name;
// Move down the hierarchy of parent classes, starting from the topmost class
......@@ -231,7 +235,7 @@ class ClassMetadataFactory
}
$class = $this->_newClassMetadataInstance($className);
if ($parent) {
$class->setInheritanceType($parent->inheritanceType);
$class->setDiscriminatorColumn($parent->discriminatorColumn);
......@@ -262,8 +266,8 @@ class ClassMetadataFactory
} else if ($parent->isIdGeneratorTable()) {
$class->getTableGeneratorDefinition($parent->tableGeneratorDefinition);
}
if ($generatorType = $parent->generatorType) {
$class->setIdGeneratorType($generatorType);
if ($parent->generatorType) {
$class->setIdGeneratorType($parent->generatorType);
}
if ($parent->idGenerator) {
$class->setIdGenerator($parent->idGenerator);
......@@ -282,18 +286,18 @@ class ClassMetadataFactory
$eventArgs = new \Doctrine\ORM\Event\LoadClassMetadataEventArgs($class);
$this->_evm->dispatchEvent(Events::loadClassMetadata, $eventArgs);
}
$this->_loadedMetadata[$className] = $class;
$parent = $class;
if ( ! $class->isMappedSuperclass) {
array_unshift($visited, $className);
}
$loaded[] = $className;
}
return $loaded;
}
......@@ -320,31 +324,33 @@ class ClassMetadataFactory
if ( ! isset($mapping['inherited']) && ! $parentClass->isMappedSuperclass) {
$mapping['inherited'] = $parentClass->name;
}
$subClass->addFieldMapping($mapping);
if ( ! isset($mapping['declared'])) {
$mapping['declared'] = $parentClass->name;
}
$subClass->addInheritedFieldMapping($mapping);
}
foreach ($parentClass->reflFields as $name => $field) {
$subClass->reflFields[$name] = $field;
}
}
/**
* Adds inherited associations to the subclass mapping.
* Adds inherited association mappings to the subclass mapping.
*
* @param Doctrine\ORM\Mapping\ClassMetadata $subClass
* @param Doctrine\ORM\Mapping\ClassMetadata $parentClass
*/
private function _addInheritedRelations(ClassMetadata $subClass, ClassMetadata $parentClass)
{
foreach ($parentClass->associationMappings as $mapping) {
if (isset($parentClass->inheritedAssociationFields[$mapping->sourceFieldName])) {
// parent class also inherited that one
$subClass->addAssociationMapping($mapping, $parentClass->inheritedAssociationFields[$mapping->sourceFieldName]);
} else if ( ! $parentClass->isMappedSuperclass) {
// parent class defined that one
$subClass->addAssociationMapping($mapping, $parentClass->name);
} else {
$subClass->addAssociationMapping($mapping);
foreach ($parentClass->associationMappings as $field => $mapping) {
$subclassMapping = clone $mapping;
if ( ! isset($mapping->inherited) && ! $parentClass->isMappedSuperclass) {
$subclassMapping->inherited = $parentClass->name;
}
if ( ! isset($mapping->declared)) {
$subclassMapping->declared = $parentClass->name;
}
$subClass->addInheritedAssociationMapping($subclassMapping);
}
}
......@@ -354,7 +360,7 @@ class ClassMetadataFactory
*
* @param Doctrine\ORM\Mapping\ClassMetadata $class
*/
private function _completeIdGeneratorMapping(ClassMetadata $class)
private function _completeIdGeneratorMapping(ClassMetadataInfo $class)
{
$idGenType = $class->generatorType;
if ($idGenType == ClassMetadata::GENERATOR_TYPE_AUTO) {
......
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
......@@ -158,7 +156,7 @@ class ClassMetadataInfo
public $parentClasses = array();
/**
* READ-ONLY: The names of all subclasses.
* READ-ONLY: The names of all subclasses (descendants).
*
* @var array
*/
......@@ -195,9 +193,9 @@ class ClassMetadataInfo
* - <b>fieldName</b> (string)
* The name of the field in the Entity.
*
* - <b>type</b> (object Doctrine\DBAL\Types\* or custom type)
* The type of the column. Can be one of Doctrine's portable types
* or a custom type.
* - <b>type</b> (string)
* The type name of the mapped field. Can be one of Doctrine's mapping types
* or a custom mapping type.
*
* - <b>columnName</b> (string, optional)
* The column name. Optional. Defaults to the field name.
......@@ -207,15 +205,9 @@ class ClassMetadataInfo
* the type.
*
* - <b>id</b> (boolean, optional)
* Marks the field as the primary key of the Entity. Multiple fields of an
* Marks the field as the primary key of the entity. Multiple fields of an
* entity can have the id attribute, forming a composite key.
*
* - <b>idGenerator</b> (string, optional)
* Either: idGenerator => 'nameOfGenerator', usually only for TABLE/SEQUENCE generators
* Or: idGenerator => 'identity' or 'auto' or 'table' or 'sequence'
* Note that 'auto', 'table', 'sequence' and 'identity' are reserved names and
* therefore cant be used as a generator name!
*
* - <b>nullable</b> (boolean, optional)
* Whether the column is nullable. Defaults to FALSE.
*
......@@ -306,7 +298,7 @@ class ClassMetadataInfo
public $lifecycleCallbacks = array();
/**
* READ-ONLY: The association mappings. All mappings, inverse and owning side.
* READ-ONLY: The association mappings of this class.
*
* @var array
*/
......@@ -323,6 +315,7 @@ class ClassMetadataInfo
* READ-ONLY: The ID generator used for generating IDs for this class.
*
* @var AbstractIdGenerator
* @todo Remove
*/
public $idGenerator;
......@@ -358,15 +351,6 @@ class ClassMetadataInfo
*/
public $changeTrackingPolicy = self::CHANGETRACKING_DEFERRED_IMPLICIT;
/**
* READ-ONLY: A map of field names to class names, where the field names are association
* fields that have been inherited from another class and values are the names
* of the classes that define the association.
*
* @var array
*/
public $inheritedAssociationFields = array();
/**
* READ-ONLY: A flag for whether or not instances of this class are to be versioned
* with optimistic locking.
......@@ -592,16 +576,6 @@ class ClassMetadataInfo
}
}
/**
* Maps an embedded value object.
*
* @todo Implementation.
*/
/*public function mapEmbeddedValue()
{
//...
}*/
/**
* Gets the identifier (primary key) field names of the class.
*
......@@ -708,7 +682,7 @@ class ClassMetadataInfo
/**
* Checks whether the mapped class uses an Id generator.
*
* @return boolean TRUE if the mapped class uses an Id generator, FALSE otherwise.
* @return boolean TRUE if the mapped class uses an Id generator, FALSE otherwise.
*/
public function usesIdGenerator()
{
......@@ -716,7 +690,6 @@ class ClassMetadataInfo
}
/**
*
* @return boolean
*/
public function isInheritanceTypeNone()
......@@ -856,16 +829,6 @@ class ClassMetadataInfo
}
}
/**
* Checks whether the class has any persistent subclasses.
*
* @return boolean TRUE if the class has one or more persistent subclasses, FALSE otherwise.
*/
public function hasSubclasses()
{
return ! $this->subClasses;
}
/**
* Sets the parent class names.
* Assumes that the class names in the passed array are in the order:
......@@ -879,16 +842,6 @@ class ClassMetadataInfo
}
}
/**
* Checks whether the class has any persistent parent classes.
*
* @return boolean TRUE if the class has one or more persistent parent classes, FALSE otherwise.
*/
public function hasParentClasses()
{
return ! $this->parentClasses;
}
/**
* Sets the inheritance type used by the class and it's subclasses.
*
......@@ -903,7 +856,7 @@ class ClassMetadataInfo
}
/**
* Checks whether a mapped field is inherited from a superclass.
* Checks whether a mapped field is inherited from an entity superclass.
*
* @return boolean TRUE if the field is inherited, FALSE otherwise.
*/
......@@ -920,7 +873,7 @@ class ClassMetadataInfo
*/
public function isInheritedAssociation($fieldName)
{
return isset($this->inheritedAssociationFields[$fieldName]);
return isset($this->associationMappings[$fieldName]->inherited);
}
/**
......@@ -963,21 +916,6 @@ class ClassMetadataInfo
$type == self::INHERITANCE_TYPE_TABLE_PER_CLASS;
}
/**
* Checks whether the given type identifies an id generator type.
*
* @param string $type
* @return boolean
*/
private function _isIdGeneratorType($type)
{
return $type == self::GENERATOR_TYPE_AUTO ||
$type == self::GENERATOR_TYPE_IDENTITY ||
$type == self::GENERATOR_TYPE_SEQUENCE ||
$type == self::GENERATOR_TYPE_TABLE ||
$type == self::GENERATOR_TYPE_NONE;
}
/**
* Makes some automatic additions to the association mapping to make the life
* easier for the user, and store join columns in the metadata.
......@@ -995,7 +933,7 @@ class ClassMetadataInfo
}
/**
* Adds a field mapping.
* Adds a mapped field to the class.
*
* @param array $mapping The field mapping.
*/
......@@ -1015,18 +953,13 @@ class ClassMetadataInfo
*
* @param AssociationMapping $mapping
* @param string $owningClassName The name of the class that defined this mapping.
* @todo Rename: addInheritedAssociationMapping
*/
public function addAssociationMapping(AssociationMapping $mapping, $owningClassName = null)
public function addInheritedAssociationMapping(AssociationMapping $mapping/*, $owningClassName = null*/)
{
$sourceFieldName = $mapping->sourceFieldName;
if (isset($this->associationMappings[$sourceFieldName])) {
throw MappingException::duplicateAssociationMapping($this->name, $sourceFieldName);
}
$this->associationMappings[$sourceFieldName] = $mapping;
if ($owningClassName !== null) {
$this->inheritedAssociationFields[$sourceFieldName] = $owningClassName;
if (isset($this->associationMappings[$mapping->sourceFieldName])) {
throw MappingException::duplicateAssociationMapping($this->name, $mapping->sourceFieldName);
}
$this->associationMappings[$mapping->sourceFieldName] = $mapping;
}
/**
......@@ -1037,7 +970,7 @@ class ClassMetadataInfo
* @param array $mapping
* @todo Rename: addInheritedFieldMapping
*/
public function addFieldMapping(array $fieldMapping)
public function addInheritedFieldMapping(array $fieldMapping)
{
$this->fieldMappings[$fieldMapping['fieldName']] = $fieldMapping;
$this->columnNames[$fieldMapping['fieldName']] = $fieldMapping['columnName'];
......@@ -1119,8 +1052,8 @@ class ClassMetadataInfo
* Dispatches the lifecycle event of the given entity to the registered
* lifecycle callbacks and lifecycle listeners.
*
* @param string $event The lifecycle event.
* @param Entity $entity The Entity on which the event occured.
* @param string $event The lifecycle event.
* @param Entity $entity The Entity on which the event occured.
*/
public function invokeLifecycleCallbacks($lifecycleEvent, $entity)
{
......@@ -1225,17 +1158,6 @@ class ClassMetadataInfo
}
}
/**
* Checks whether the given column name is the discriminator column.
*
* @param string $columnName
* @return boolean
*/
public function isDiscriminatorColumn($columnName)
{
return $columnName === $this->discriminatorColumn['name'];
}
/**
* Checks whether the class has a mapped association with the given field name.
*
......@@ -1304,7 +1226,7 @@ class ClassMetadataInfo
/**
* Sets the version field mapping used for versioning. Sets the default
* value to use depending on the column type
* value to use depending on the column type.
*
* @param array $mapping The version field mapping array
*/
......
......@@ -155,7 +155,7 @@ abstract class AbstractFileDriver implements Driver
if ($this->_paths) {
foreach ((array) $this->_paths as $path) {
if ( ! is_dir($path)) {
throw MappingException::driverRequiresConfiguredDirectoryPath();
throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath();
}
$iterator = new \RecursiveIteratorIterator(
......
......@@ -428,40 +428,41 @@ class AnnotationDriver implements Driver
return $this->_classNames;
}
$classes = array();
if (!$this->_paths) {
throw MappingException::pathRequired();
}
if ($this->_paths) {
$includedFiles = array();
$classes = array();
$includedFiles = array();
foreach ((array) $this->_paths as $path) {
if ( ! is_dir($path)) {
throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath();
}
foreach ($this->_paths as $path) {
if ( ! is_dir($path)) {
throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath();
}
$iterator = new \RecursiveIteratorIterator(
new \RecursiveDirectoryIterator($path),
\RecursiveIteratorIterator::LEAVES_ONLY
);
$iterator = new \RecursiveIteratorIterator(
new \RecursiveDirectoryIterator($path),
\RecursiveIteratorIterator::LEAVES_ONLY
);
foreach ($iterator as $file) {
if (($fileName = $file->getBasename($this->_fileExtension)) == $file->getBasename()) {
continue;
}
$sourceFile = realpath($file->getPathName());
require_once $sourceFile;
$includedFiles[] = $sourceFile;
foreach ($iterator as $file) {
if (($fileName = $file->getBasename($this->_fileExtension)) == $file->getBasename()) {
continue;
}
$sourceFile = realpath($file->getPathName());
require_once $sourceFile;
$includedFiles[] = $sourceFile;
}
}
$declared = get_declared_classes();
$declared = get_declared_classes();
foreach ($declared as $className) {
$rc = new \ReflectionClass($className);
$sourceFile = $rc->getFileName();
if (in_array($sourceFile, $includedFiles) && ! $this->isTransient($className)) {
$classes[] = $className;
}
foreach ($declared as $className) {
$rc = new \ReflectionClass($className);
$sourceFile = $rc->getFileName();
if (in_array($sourceFile, $includedFiles) && ! $this->isTransient($className)) {
$classes[] = $className;
}
}
......@@ -470,4 +471,19 @@ class AnnotationDriver implements Driver
return $classes;
}
/**
* Factory method for the Annotation Driver
*
* @param array|string $paths
* @param AnnotationReader $reader
* @return AnnotationDriver
*/
static public function create($paths = array(), AnnotationReader $reader = null)
{
if ($reader == null) {
$reader = new AnnotationReader();
$reader->setDefaultAnnotationNamespace('Doctrine\ORM\Mapping\\');
}
return new self($reader, $paths);
}
}
......@@ -28,6 +28,12 @@ namespace Doctrine\ORM\Mapping;
*/
class MappingException extends \Doctrine\ORM\ORMException
{
public static function pathRequired()
{
return new self("Specifying the paths to your entities is required ".
"in the AnnotationDriver to retrieve all class names.");
}
public static function identifierRequired($entityName)
{
return new self("No identifier/primary key specified for Entity '$entityName'."
......
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
......@@ -21,8 +19,6 @@
namespace Doctrine\ORM;
use Doctrine\DBAL\Types\Type;
/**
* Represents a native SQL query.
*
......
......@@ -10,6 +10,12 @@ namespace Doctrine\ORM;
*/
class ORMException extends \Exception
{
public static function missingMappingDriverImpl()
{
return new self("It's a requirement to specify a Metadata Driver and pass it ".
"to Doctrine\ORM\Configuration::setMetadataDriverImpl().");
}
public static function entityMissingAssignedId($entity)
{
return new self("Entity of type " . get_class($entity) . " is missing an assigned ID.");
......
......@@ -24,11 +24,8 @@ namespace Doctrine\ORM;
/**
* OptimisticLockException
*
* @author Roman Borschel <roman@code-factory.org>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision$
* @author Roman Borschel <roman@code-factory.org>
* @since 2.0
*/
class OptimisticLockException extends ORMException
{
......
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
......@@ -33,19 +31,17 @@ use Doctrine\ORM\EntityManager,
abstract class AbstractCollectionPersister
{
/**
*
* @var EntityManager
*/
protected $_em;
/**
* @var \Doctrine\DBAL\Connection
* @var Doctrine\DBAL\Connection
*/
protected $_conn;
/**
*
* @var \Doctrine\ORM\UnitOfWork
* @var Doctrine\ORM\UnitOfWork
*/
protected $_uow;
......@@ -71,8 +67,8 @@ abstract class AbstractCollectionPersister
if ( ! $coll->getMapping()->isOwningSide) {
return; // ignore inverse side
}
$sql = $this->_getDeleteSql($coll);
$this->_conn->executeUpdate($sql, $this->_getDeleteSqlParameters($coll));
$sql = $this->_getDeleteSQL($coll);
$this->_conn->executeUpdate($sql, $this->_getDeleteSQLParameters($coll));
}
/**
......@@ -80,7 +76,7 @@ abstract class AbstractCollectionPersister
*
* @param PersistentCollection $coll
*/
abstract protected function _getDeleteSql(PersistentCollection $coll);
abstract protected function _getDeleteSQL(PersistentCollection $coll);
/**
* Gets the SQL parameters for the corresponding SQL statement to delete
......@@ -88,7 +84,7 @@ abstract class AbstractCollectionPersister
*
* @param PersistentCollection $coll
*/
abstract protected function _getDeleteSqlParameters(PersistentCollection $coll);
abstract protected function _getDeleteSQLParameters(PersistentCollection $coll);
/**
* Updates the given collection, synchronizing it's state with the database
......@@ -109,9 +105,9 @@ abstract class AbstractCollectionPersister
public function deleteRows(PersistentCollection $coll)
{
$deleteDiff = $coll->getDeleteDiff();
$sql = $this->_getDeleteRowSql($coll);
$sql = $this->_getDeleteRowSQL($coll);
foreach ($deleteDiff as $element) {
$this->_conn->executeUpdate($sql, $this->_getDeleteRowSqlParameters($coll, $element));
$this->_conn->executeUpdate($sql, $this->_getDeleteRowSQLParameters($coll, $element));
}
}
......@@ -121,9 +117,9 @@ abstract class AbstractCollectionPersister
public function insertRows(PersistentCollection $coll)
{
$insertDiff = $coll->getInsertDiff();
$sql = $this->_getInsertRowSql($coll);
$sql = $this->_getInsertRowSQL($coll);
foreach ($insertDiff as $element) {
$this->_conn->executeUpdate($sql, $this->_getInsertRowSqlParameters($coll, $element));
$this->_conn->executeUpdate($sql, $this->_getInsertRowSQLParameters($coll, $element));
}
}
......@@ -132,7 +128,7 @@ abstract class AbstractCollectionPersister
*
* @param PersistentCollection $coll
*/
abstract protected function _getDeleteRowSql(PersistentCollection $coll);
abstract protected function _getDeleteRowSQL(PersistentCollection $coll);
/**
* Gets the SQL parameters for the corresponding SQL statement to delete the given
......@@ -141,21 +137,21 @@ abstract class AbstractCollectionPersister
* @param PersistentCollection $coll
* @param mixed $element
*/
abstract protected function _getDeleteRowSqlParameters(PersistentCollection $coll, $element);
abstract protected function _getDeleteRowSQLParameters(PersistentCollection $coll, $element);
/**
* Gets the SQL statement used for updating a row in the collection.
*
* @param PersistentCollection $coll
*/
abstract protected function _getUpdateRowSql(PersistentCollection $coll);
abstract protected function _getUpdateRowSQL(PersistentCollection $coll);
/**
* Gets the SQL statement used for inserting a row in the collection.
*
* @param PersistentCollection $coll
*/
abstract protected function _getInsertRowSql(PersistentCollection $coll);
abstract protected function _getInsertRowSQL(PersistentCollection $coll);
/**
* Gets the SQL parameters for the corresponding SQL statement to insert the given
......@@ -164,5 +160,5 @@ abstract class AbstractCollectionPersister
* @param PersistentCollection $coll
* @param mixed $element
*/
abstract protected function _getInsertRowSqlParameters(PersistentCollection $coll, $element);
abstract protected function _getInsertRowSQLParameters(PersistentCollection $coll, $element);
}
\ No newline at end of file
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
......
......@@ -78,14 +78,10 @@ class JoinedSubclassPersister extends AbstractEntityInheritancePersister
public function getOwningTable($fieldName)
{
if ( ! isset($this->_owningTableMap[$fieldName])) {
if (isset($this->_class->associationMappings[$fieldName])) {
if (isset($this->_class->inheritedAssociationFields[$fieldName])) {
$this->_owningTableMap[$fieldName] = $this->_em->getClassMetadata(
$this->_class->inheritedAssociationFields[$fieldName]
)->table['name'];
} else {
$this->_owningTableMap[$fieldName] = $this->_class->table['name'];
}
if (isset($this->_class->associationMappings[$fieldName]->inherited)) {
$this->_owningTableMap[$fieldName] = $this->_em->getClassMetadata(
$this->_class->associationMappings[$fieldName]->inherited
)->table['name'];
} else if (isset($this->_class->fieldMappings[$fieldName]['inherited'])) {
$this->_owningTableMap[$fieldName] = $this->_em->getClassMetadata(
$this->_class->fieldMappings[$fieldName]['inherited']
......@@ -252,9 +248,9 @@ class JoinedSubclassPersister extends AbstractEntityInheritancePersister
// Add foreign key columns
foreach ($this->_class->associationMappings as $assoc) {
if ($assoc->isOwningSide && $assoc->isOneToOne()) {
$tableAlias = isset($this->_class->inheritedAssociationFields[$assoc->sourceFieldName]) ?
$this->_getSQLTableAlias($this->_em->getClassMetadata($this->_class->inheritedAssociationFields[$assoc->sourceFieldName]))
: $baseTableAlias;
$tableAlias = $assoc->inherited ?
$this->_getSQLTableAlias($this->_em->getClassMetadata($assoc->inherited))
: $baseTableAlias;
foreach ($assoc->targetToSourceKeyColumns as $srcColumn) {
$columnAlias = $srcColumn . $this->_sqlAliasCounter++;
$columnList .= ", $tableAlias.$srcColumn AS $columnAlias";
......@@ -308,7 +304,7 @@ class JoinedSubclassPersister extends AbstractEntityInheritancePersister
// Add join columns (foreign keys)
foreach ($subClass->associationMappings as $assoc2) {
if ($assoc2->isOwningSide && $assoc2->isOneToOne() && ! isset($subClass->inheritedAssociationFields[$assoc2->sourceFieldName])) {
if ($assoc2->isOwningSide && $assoc2->isOneToOne() && ! $assoc2->inherited) {
foreach ($assoc2->targetToSourceKeyColumns as $srcColumn) {
$columnAlias = $srcColumn . $this->_sqlAliasCounter++;
$columnList .= ', ' . $tableAlias . ".$srcColumn AS $columnAlias";
......@@ -377,7 +373,7 @@ class JoinedSubclassPersister extends AbstractEntityInheritancePersister
foreach ($this->_class->reflFields as $name => $field) {
if (isset($this->_class->fieldMappings[$name]['inherited']) && ! isset($this->_class->fieldMappings[$name]['id'])
|| isset($this->_class->inheritedAssociationFields[$name])
|| isset($this->_class->associationMappings[$name]->inherited)
|| ($this->_class->isVersioned && $this->_class->versionField == $name)) {
continue;
}
......
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
......@@ -63,7 +61,7 @@ class SingleTablePersister extends AbstractEntityInheritancePersister
// Append subclass foreign keys
foreach ($subClass->associationMappings as $assoc) {
if ($assoc->isOwningSide && $assoc->isOneToOne() && ! isset($subClass->inheritedAssociationFields[$assoc->sourceFieldName])) {
if ($assoc->isOwningSide && $assoc->isOneToOne() && ! $assoc->inherited) {
foreach ($assoc->targetToSourceKeyColumns as $srcColumn) {
$columnAlias = $srcColumn . $this->_sqlAliasCounter++;
$columnList .= ', ' . $tableAlias . ".$srcColumn AS $columnAlias";
......
......@@ -704,6 +704,7 @@ class StandardEntityPersister
$tableAlias = isset($this->_class->fieldMappings[$fieldName]['inherited']) ?
$this->_getSQLTableAlias($this->_em->getClassMetadata($this->_class->fieldMappings[$fieldName]['inherited']))
: $baseTableAlias;
$columnName = $this->_class->getQuotedColumnName($fieldName, $this->_platform);
if ($orderBySql != '') {
$orderBySql .= ', ';
......
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
......@@ -27,13 +25,10 @@ use Doctrine\ORM\Query\Parser,
/**
* A Query object represents a DQL query.
*
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 1.0
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @author Roman Borschel <roman@code-factory.org>
* @since 1.0
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @author Roman Borschel <roman@code-factory.org>
*/
final class Query extends AbstractQuery
{
......@@ -62,6 +57,7 @@ final class Query extends AbstractQuery
* partial objects.
*
* @var string
* @todo Rename: HINT_OPTIMIZE
*/
const HINT_FORCE_PARTIAL_LOAD = 'doctrine.forcePartialLoad';
/**
......@@ -154,10 +150,10 @@ final class Query extends AbstractQuery
*
* @param Doctrine\ORM\EntityManager $entityManager
*/
public function __construct(EntityManager $entityManager)
/*public function __construct(EntityManager $entityManager)
{
parent::__construct($entityManager);
}
}*/
/**
* Gets the SQL query/queries that correspond to this DQL query.
......@@ -167,7 +163,7 @@ final class Query extends AbstractQuery
*/
public function getSQL()
{
return $this->_parse()->getSqlExecutor()->getSqlStatements();
return $this->_parse()->getSQLExecutor()->getSQLStatements();
}
/**
......@@ -371,7 +367,7 @@ final class Query extends AbstractQuery
* @param string $dqlQuery DQL Query
* @return Doctrine\ORM\AbstractQuery
*/
public function setDql($dqlQuery)
public function setDQL($dqlQuery)
{
if ($dqlQuery !== null) {
$this->_dql = $dqlQuery;
......@@ -385,7 +381,7 @@ final class Query extends AbstractQuery
*
* @return string DQL query
*/
public function getDql()
public function getDQL()
{
return $this->_dql;
}
......@@ -413,7 +409,7 @@ final class Query extends AbstractQuery
*/
public function contains($dql)
{
return stripos($this->getDql(), $dql) === false ? false : true;
return stripos($this->getDQL(), $dql) === false ? false : true;
}
/**
......
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
......@@ -29,11 +27,8 @@ use Doctrine\DBAL\Connection,
* Executes the SQL statements for bulk DQL UPDATE statements on classes in
* Class Table Inheritance (JOINED).
*
* @author Roman Borschel <roman@code-factory.org>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link http://www.doctrine-project.org
* @since 2.0
* @version $Revision$
* @author Roman Borschel <roman@code-factory.org>
* @since 2.0
*/
class MultiTableUpdateExecutor extends AbstractSqlExecutor
{
......
......@@ -451,7 +451,7 @@ class SqlWalker implements TreeWalker
$class = $this->_em->getClassMetadata($class->fieldMappings[$fieldName]['inherited']);
}
return $this->getSqlTableAlias($class->table['name'], $identificationVariable);
return $this->getSQLTableAlias($class->table['name'], $identificationVariable);
}
/**
......@@ -484,6 +484,11 @@ class SqlWalker implements TreeWalker
$fieldName = array_pop($parts);
$dqlAlias = $pathExpr->identificationVariable;
$class = $this->_queryComponents[$dqlAlias]['metadata'];
if (isset($class->associationMappings[$fieldName]->inherited)) {
$class = $this->_em->getClassMetadata($class->associationMappings[$fieldName]->inherited);
}
$assoc = $class->associationMappings[$fieldName];
if ($assoc->isOwningSide) {
......@@ -491,8 +496,8 @@ class SqlWalker implements TreeWalker
if (count($assoc->sourceToTargetKeyColumns) > 1) {
throw QueryException::associationPathCompositeKeyNotSupported();
}
$sql .= $this->walkIdentificationVariable($dqlAlias) . '.'
. reset($assoc->targetToSourceKeyColumns);
$sql .= $this->getSqlTableAlias($class->table['name'], $dqlAlias) . '.'
. reset($assoc->targetToSourceKeyColumns);
} else {
// 2- Inverse side: NOT (YET?) SUPPORTED
throw QueryException::associationPathInverseSideNotSupported();
......@@ -552,8 +557,8 @@ class SqlWalker implements TreeWalker
//FIXME: Include foreign key columns of child classes also!!??
foreach ($class->associationMappings as $assoc) {
if ($assoc->isOwningSide && $assoc->isOneToOne()) {
if (isset($class->inheritedAssociationFields[$assoc->sourceFieldName])) {
$owningClass = $this->_em->getClassMetadata($class->inheritedAssociationFields[$assoc->sourceFieldName]);
if ($assoc->inherited) {
$owningClass = $this->_em->getClassMetadata($assoc->inherited);
$sqlTableAlias = $this->getSqlTableAlias($owningClass->table['name'], $dqlAlias);
} else {
$sqlTableAlias = $this->getSqlTableAlias($class->table['name'], $dqlAlias);
......@@ -702,23 +707,15 @@ class SqlWalker implements TreeWalker
$joinAssocPathExpr = $join->joinAssociationPathExpression;
$joinedDqlAlias = $join->aliasIdentificationVariable;
$targetQComp = $this->_queryComponents[$joinedDqlAlias];
$targetClass = $targetQComp['metadata'];
$relation = $targetQComp['relation'];
$sourceClass = $this->_queryComponents[$joinAssocPathExpr->identificationVariable]['metadata'];
$relation = $this->_queryComponents[$joinedDqlAlias]['relation'];
$targetClass = $this->_em->getClassMetadata($relation->targetEntityName);
$sourceClass = $this->_em->getClassMetadata($relation->sourceEntityName);
$targetTableName = $targetClass->getQuotedTableName($this->_platform);
$targetTableAlias = $this->getSqlTableAlias($targetClass->getTableName(), $joinedDqlAlias);
$sourceTableAlias = $this->getSqlTableAlias(
$sourceClass->getTableName(), $joinAssocPathExpr->identificationVariable
);
$targetTableAlias = $this->getSqlTableAlias($targetClass->table['name'], $joinedDqlAlias);
$sourceTableAlias = $this->getSqlTableAlias($sourceClass->table['name'], $joinAssocPathExpr->identificationVariable);
// Ensure we got the owning side, since it has all mapping info
if ( ! $relation->isOwningSide) {
$assoc = $targetClass->associationMappings[$relation->mappedBy];
} else {
$assoc = $relation;
}
$assoc = ( ! $relation->isOwningSide) ? $targetClass->associationMappings[$relation->mappedBy] : $relation;
if ($this->_query->getHint(Query::HINT_INTERNAL_ITERATION) == true) {
if ($relation->isOneToMany() || $relation->isManyToMany()) {
......@@ -732,7 +729,7 @@ class SqlWalker implements TreeWalker
foreach ($assoc->sourceToTargetKeyColumns as $sourceColumn => $targetColumn) {
if ( ! $first) $sql .= ' AND '; else $first = false;
if ($relation->isOwningSide) {
$quotedTargetColumn = $targetClass->getQuotedColumnName($targetClass->fieldNames[$targetColumn], $this->_platform);
$sql .= $sourceTableAlias . '.' . $sourceColumn
......@@ -808,6 +805,7 @@ class SqlWalker implements TreeWalker
$sql .= ' AND ' . $discrSql;
}
//FIXME: these should either be nested or all forced to be left joins (DDC-XXX)
if ($targetClass->isInheritanceTypeJoined()) {
$sql .= $this->_generateClassTableInheritanceJoins($targetClass, $joinedDqlAlias);
}
......@@ -979,7 +977,7 @@ class SqlWalker implements TreeWalker
// Add join columns (foreign keys) of the subclass
//TODO: Probably better do this in walkSelectClause to honor the INCLUDE_META_COLUMNS hint
foreach ($subClass->associationMappings as $fieldName => $assoc) {
if ($assoc->isOwningSide && $assoc->isOneToOne() && ! isset($subClass->inheritedAssociationFields[$fieldName])) {
if ($assoc->isOwningSide && $assoc->isOneToOne() && ! $assoc->inherited) {
foreach ($assoc->targetToSourceKeyColumns as $srcColumn) {
if ($beginning) $beginning = false; else $sql .= ', ';
$columnAlias = $this->getSqlColumnAlias($srcColumn);
......
......@@ -168,7 +168,7 @@ class QueryBuilder
*
* @return string The DQL string
*/
public function getDql()
public function getDQL()
{
if ($this->_dql !== null && $this->_state === self::STATE_CLEAN) {
return $this->_dql;
......@@ -178,16 +178,16 @@ class QueryBuilder
switch ($this->_type) {
case self::DELETE:
$dql = $this->_getDqlForDelete();
$dql = $this->_getDQLForDelete();
break;
case self::UPDATE:
$dql = $this->_getDqlForUpdate();
$dql = $this->_getDQLForUpdate();
break;
case self::SELECT:
default:
$dql = $this->_getDqlForSelect();
$dql = $this->_getDQLForSelect();
break;
}
......@@ -211,7 +211,7 @@ class QueryBuilder
*/
public function getQuery()
{
return $this->_em->createQuery($this->getDql())
return $this->_em->createQuery($this->getDQL())
->setParameters($this->_params)
->setFirstResult($this->_firstResult)
->setMaxResults($this->_maxResults);
......@@ -613,7 +613,7 @@ class QueryBuilder
*/
public function andWhere($where)
{
$where = $this->getDqlPart('where');
$where = $this->getDQLPart('where');
$args = func_get_args();
if ($where instanceof Expr\Andx) {
......@@ -744,7 +744,7 @@ class QueryBuilder
array_unshift($args, $having);
$having = new Expr\Orx($args);
}
return $this->add('having', $having);
}
......@@ -779,7 +779,7 @@ class QueryBuilder
* @param string $queryPartName
* @return mixed $queryPart
*/
public function getDqlPart($queryPartName)
public function getDQLPart($queryPartName)
{
return $this->_dqlParts[$queryPartName];
}
......@@ -789,43 +789,43 @@ class QueryBuilder
*
* @return array $dqlParts
*/
public function getDqlParts()
public function getDQLParts()
{
return $this->_dqlParts;
}
private function _getDqlForDelete()
private function _getDQLForDelete()
{
return 'DELETE'
. $this->_getReducedDqlQueryPart('from', array('pre' => ' ', 'separator' => ', '))
. $this->_getReducedDqlQueryPart('where', array('pre' => ' WHERE '))
. $this->_getReducedDqlQueryPart('orderBy', array('pre' => ' ORDER BY ', 'separator' => ', '));
. $this->_getReducedDQLQueryPart('from', array('pre' => ' ', 'separator' => ', '))
. $this->_getReducedDQLQueryPart('where', array('pre' => ' WHERE '))
. $this->_getReducedDQLQueryPart('orderBy', array('pre' => ' ORDER BY ', 'separator' => ', '));
}
private function _getDqlForUpdate()
private function _getDQLForUpdate()
{
return 'UPDATE'
. $this->_getReducedDqlQueryPart('from', array('pre' => ' ', 'separator' => ', '))
. $this->_getReducedDqlQueryPart('set', array('pre' => ' SET ', 'separator' => ', '))
. $this->_getReducedDqlQueryPart('where', array('pre' => ' WHERE '))
. $this->_getReducedDqlQueryPart('orderBy', array('pre' => ' ORDER BY ', 'separator' => ', '));
. $this->_getReducedDQLQueryPart('from', array('pre' => ' ', 'separator' => ', '))
. $this->_getReducedDQLQueryPart('set', array('pre' => ' SET ', 'separator' => ', '))
. $this->_getReducedDQLQueryPart('where', array('pre' => ' WHERE '))
. $this->_getReducedDQLQueryPart('orderBy', array('pre' => ' ORDER BY ', 'separator' => ', '));
}
private function _getDqlForSelect()
private function _getDQLForSelect()
{
return 'SELECT'
. $this->_getReducedDqlQueryPart('select', array('pre' => ' ', 'separator' => ', '))
. $this->_getReducedDqlQueryPart('from', array('pre' => ' FROM ', 'separator' => ', '))
. $this->_getReducedDqlQueryPart('join', array('pre' => ' ', 'separator' => ' '))
. $this->_getReducedDqlQueryPart('where', array('pre' => ' WHERE '))
. $this->_getReducedDqlQueryPart('groupBy', array('pre' => ' GROUP BY ', 'separator' => ', '))
. $this->_getReducedDqlQueryPart('having', array('pre' => ' HAVING '))
. $this->_getReducedDqlQueryPart('orderBy', array('pre' => ' ORDER BY ', 'separator' => ', '));
. $this->_getReducedDQLQueryPart('select', array('pre' => ' ', 'separator' => ', '))
. $this->_getReducedDQLQueryPart('from', array('pre' => ' FROM ', 'separator' => ', '))
. $this->_getReducedDQLQueryPart('join', array('pre' => ' ', 'separator' => ' '))
. $this->_getReducedDQLQueryPart('where', array('pre' => ' WHERE '))
. $this->_getReducedDQLQueryPart('groupBy', array('pre' => ' GROUP BY ', 'separator' => ', '))
. $this->_getReducedDQLQueryPart('having', array('pre' => ' HAVING '))
. $this->_getReducedDQLQueryPart('orderBy', array('pre' => ' ORDER BY ', 'separator' => ', '));
}
private function _getReducedDqlQueryPart($queryPartName, $options = array())
private function _getReducedDQLQueryPart($queryPartName, $options = array())
{
$queryPart = $this->getDqlPart($queryPartName);
$queryPart = $this->getDQLPart($queryPartName);
if (empty($queryPart)) {
return (isset($options['empty']) ? $options['empty'] : '');
......@@ -838,11 +838,6 @@ class QueryBuilder
public function __toString()
{
return $this->getDql();
return $this->getDQL();
}
/*public function __clone()
{
$this->_q = clone $this->_q;
}*/
}
\ No newline at end of file
This diff is collapsed.
......@@ -95,9 +95,9 @@ EOT
$deleted = $cacheDriver->delete($id);
if (is_array($deleted)) {
$this->_printDeleted($deleted);
$this->_printDeleted($output, $deleted);
} else if (is_bool($deleted) && $deleted) {
$this->_printDeleted(array($id));
$this->_printDeleted($output, array($id));
}
$outputed = true;
......@@ -105,12 +105,12 @@ EOT
}
// Removing based on --regex
if (($regex = $input->getOption('regex')) !== null && $regexps) {
if (($regexps = $input->getOption('regex')) !== null && $regexps) {
foreach($regexps as $regex) {
$output->write($outputed ? PHP_EOL : '');
$output->write(sprintf('Clearing Result cache entries that match the regular expression "<info>%s</info>"', $regex) . PHP_EOL);
$this->_printDeleted($cacheDriver->deleteByRegex('/' . $regex. '/'));
$this->_printDeleted($output, $cacheDriver->deleteByRegex('/' . $regex. '/'));
$outputed = true;
}
......@@ -122,7 +122,7 @@ EOT
$output->write($outputed ? PHP_EOL : '');
$output->write(sprintf('Clearing Result cache entries that have the prefix "<info>%s</info>"', $prefix) . PHP_EOL);
$this->_printDeleted($cacheDriver->deleteByPrefix($prefix));
$this->_printDeleted($output, $cacheDriver->deleteByPrefix($prefix));
$outputed = true;
}
......@@ -134,7 +134,7 @@ EOT
$output->write($outputed ? PHP_EOL : '');
$output->write(sprintf('Clearing Result cache entries that have the suffix "<info>%s</info>"', $suffix) . PHP_EOL);
$this->_printDeleted($cacheDriver->deleteBySuffix($suffix));
$this->_printDeleted($output, $cacheDriver->deleteBySuffix($suffix));
$outputed = true;
}
......@@ -143,9 +143,9 @@ EOT
// Removing ALL entries
if ( ! $ids && ! $regexps && ! $prefixes && ! $suffixes) {
$output->write($outputed ? PHP_EOL : '');
$output->write('Clearing ALL Result cache entries');
$output->write('Clearing ALL Result cache entries' . PHP_EOL);
$this->_printDeleted($cacheDriver->deleteAll());
$this->_printDeleted($output, $cacheDriver->deleteAll());
$outputed = true;
}
......
......@@ -23,7 +23,9 @@ namespace Doctrine\ORM\Tools\Console\Command;
use Symfony\Components\Console\Input\InputArgument,
Symfony\Components\Console\Input\InputOption,
Symfony\Components\Console;
Symfony\Components\Console,
Doctrine\ORM\Tools\Export\ClassMetadataExporter,
Doctrine\ORM\Tools\ConvertDoctrine1Schema;
/**
* Command to convert a Doctrine 1 schema to a Doctrine 2 mapping file.
......
......@@ -23,7 +23,11 @@ namespace Doctrine\ORM\Tools\Console\Command;
use Symfony\Components\Console\Input\InputArgument,
Symfony\Components\Console\Input\InputOption,
Symfony\Components\Console;
Symfony\Components\Console,
Doctrine\ORM\Tools\Console\MetadataFilter,
Doctrine\ORM\Tools\Export\ClassMetadataExporter,
Doctrine\ORM\Tools\EntityGenerator,
Doctrine\ORM\Tools\DisconnectedClassMetadataFactory;
/**
* Command to convert your mapping information between the various formats.
......@@ -48,8 +52,9 @@ class ConvertMappingCommand extends Console\Command\Command
->setName('orm:convert-mapping')
->setDescription('Convert mapping information between supported formats.')
->setDefinition(array(
new InputArgument(
'from-path', InputArgument::REQUIRED, 'The path of mapping information.'
new InputOption(
'filter', null, InputOption::PARAMETER_REQUIRED | InputOption::PARAMETER_IS_ARRAY,
'A string pattern used to match entities that should be processed.'
),
new InputArgument(
'to-type', InputArgument::REQUIRED, 'The mapping type to be converted.'
......@@ -59,9 +64,7 @@ class ConvertMappingCommand extends Console\Command\Command
'The path to generate your entities classes.'
),
new InputOption(
'from', null, InputOption::PARAMETER_REQUIRED | InputOption::PARAMETER_IS_ARRAY,
'Optional paths of mapping information.',
array()
'from-database', null, null, 'Whether or not to convert mapping information from existing database.'
),
new InputOption(
'extend', null, InputOption::PARAMETER_OPTIONAL,
......@@ -84,41 +87,24 @@ EOT
protected function execute(Console\Input\InputInterface $input, Console\Output\OutputInterface $output)
{
$em = $this->getHelper('em')->getEntityManager();
$cme = new ClassMetadataExporter();
// Process source directories
$fromPath = $input->getArgument('from-path');
if (strtolower($fromPath) !== 'database') {
$fromPaths = array_merge(array($fromPath), $input->getOption('from'));
foreach ($fromPaths as &$dirName) {
$dirName = realpath($dirName);
if ( ! file_exists($dirName)) {
throw new \InvalidArgumentException(
sprintf("Mapping directory '<info>%s</info>' does not exist.", $dirName)
);
} else if ( ! is_readable($dirName)) {
throw new \InvalidArgumentException(
sprintf("Mapping directory '<info>%s</info>' does not have read permissions.", $dirName)
);
}
$cme->addMappingSource($dirName);
}
} else {
if ($input->getOption('from-database') === true) {
$em->getConfiguration()->setMetadataDriverImpl(
new \Doctrine\ORM\Mapping\Driver\DatabaseDriver(
$em->getConnection()->getSchemaManager()
)
);
$cme->addMappingSource($fromPath);
}
$cmf = new DisconnectedClassMetadataFactory($em);
$metadatas = $cmf->getAllMetadata();
$metadatas = MetadataFilter::filter($metadatas, $input->getOption('filter'));
// Process destination directory
$destPath = realpath($input->getArgument('dest-path'));
if ( ! is_dir($destPath = $input->getArgument('dest-path'))) {
mkdir($destPath, 0777, true);
}
$destPath = realpath($destPath);
if ( ! file_exists($destPath)) {
throw new \InvalidArgumentException(
......@@ -132,6 +118,7 @@ EOT
$toType = strtolower($input->getArgument('to-type'));
$cme = new ClassMetadataExporter();
$exporter = $cme->getExporter($toType, $destPath);
if ($toType == 'annotation') {
......@@ -145,9 +132,7 @@ EOT
}
}
$metadatas = $cme->getMetadatas();
if ($metadatas) {
if (count($metadatas)) {
foreach ($metadatas as $metadata) {
$output->write(sprintf('Processing entity "<info>%s</info>"', $metadata->name) . PHP_EOL);
}
......@@ -156,7 +141,7 @@ EOT
$exporter->export();
$output->write(PHP_EOL . sprintf(
'Exporting "<info>%s</info>" mapping information to "<info>%s</info>"', $toType, $destPath
'Exporting "<info>%s</info>" mapping information to "<info>%s</info>"' . PHP_EOL, $toType, $destPath
));
} else {
$output->write('No Metadata Classes to process.' . PHP_EOL);
......
......@@ -65,12 +65,21 @@ EOT
protected function execute(Console\Input\InputInterface $input, Console\Output\OutputInterface $output)
{
$em = $this->getHelper('em')->getEntityManager();
$em->getConfiguration()->ensureProductionSettings();
if ($input->getOption('complete') !== null) {
$em->getConnection()->connect();
$error = false;
try {
$em->getConfiguration()->ensureProductionSettings();
if ($input->getOption('complete') !== null) {
$em->getConnection()->connect();
}
} catch (\Exception $e) {
$error = true;
$output->writeln('<error>' . $e->getMessage() . '</error>');
}
$output->write('Environment is correctly configured for production.');
if ($error === false) {
$output->write('<info>Environment is correctly configured for production.</info>' . PHP_EOL);
}
}
}
\ No newline at end of file
......@@ -23,7 +23,10 @@ namespace Doctrine\ORM\Tools\Console\Command;
use Symfony\Components\Console\Input\InputArgument,
Symfony\Components\Console\Input\InputOption,
Symfony\Components\Console;
Symfony\Components\Console,
Doctrine\ORM\Tools\Console\MetadataFilter,
Doctrine\ORM\Tools\EntityGenerator,
Doctrine\ORM\Tools\DisconnectedClassMetadataFactory;
/**
* Command to generate entity classes and method stubs from your mapping information.
......@@ -48,17 +51,13 @@ class GenerateEntitiesCommand extends Console\Command\Command
->setName('orm:generate-entities')
->setDescription('Generate entity classes and method stubs from your mapping information.')
->setDefinition(array(
new InputArgument(
'from-path', InputArgument::REQUIRED, 'The path of mapping information.'
new InputOption(
'filter', null, InputOption::PARAMETER_REQUIRED | InputOption::PARAMETER_IS_ARRAY,
'A string pattern used to match entities that should be processed.'
),
new InputArgument(
'dest-path', InputArgument::REQUIRED, 'The path to generate your entity classes.'
),
new InputOption(
'from', null, InputOption::PARAMETER_REQUIRED | InputOption::PARAMETER_IS_ARRAY,
'Optional paths of mapping information.',
array()
),
new InputOption(
'generate-annotations', null, InputOption::PARAMETER_OPTIONAL,
'Flag to define if generator should generate annotation metadata on entities.', false
......@@ -96,29 +95,11 @@ EOT
protected function execute(Console\Input\InputInterface $input, Console\Output\OutputInterface $output)
{
$em = $this->getHelper('em')->getEntityManager();
$reader = new ClassMetadataReader();
$reader->setEntityManager($em);
// Process source directories
$fromPaths = array_merge(array($input->getArgument('from-path')), $input->getOption('from'));
foreach ($fromPaths as $dirName) {
$dirName = realpath($dirName);
if ( ! file_exists($dirName)) {
throw new \InvalidArgumentException(
sprintf("Mapping directory '<info>%s</info>' does not exist.", $dirName)
);
} else if ( ! is_readable($dirName)) {
throw new \InvalidArgumentException(
sprintf("Mapping directory '<info>%s</info>' does not have read permissions.", $dirName)
);
}
$reader->addMappingSource($dirName);
}
$cmf = new DisconnectedClassMetadataFactory($em);
$metadatas = $cmf->getAllMetadata();
$metadatas = MetadataFilter::filter($metadatas, $input->getOption('filter'));
// Process destination directory
$destPath = realpath($input->getArgument('dest-path'));
......@@ -132,23 +113,20 @@ EOT
);
}
// Create EntityGenerator
$entityGenerator = new EntityGenerator();
$entityGenerator->setGenerateAnnotations($input->getOption('generate-annotations'));
$entityGenerator->setGenerateStubMethods($input->getOption('generate-methods'));
$entityGenerator->setRegenerateEntityIfExists($input->getOption('regenerate-entities'));
$entityGenerator->setUpdateEntityIfExists($input->getOption('update-entities'));
$entityGenerator->setNumSpaces($input->getOption('num-spaces'));
if ( count($metadatas)) {
// Create EntityGenerator
$entityGenerator = new EntityGenerator();
if (($extend = $input->getOption('extend')) !== null) {
$entityGenerator->setClassToExtend($extend);
}
$entityGenerator->setGenerateAnnotations($input->getOption('generate-annotations'));
$entityGenerator->setGenerateStubMethods($input->getOption('generate-methods'));
$entityGenerator->setRegenerateEntityIfExists($input->getOption('regenerate-entities'));
$entityGenerator->setUpdateEntityIfExists($input->getOption('update-entities'));
$entityGenerator->setNumSpaces($input->getOption('num-spaces'));
// Retrieving ClassMetadatas
$metadatas = $reader->getMetadatas();
if (($extend = $input->getOption('extend')) !== null) {
$entityGenerator->setClassToExtend($extend);
}
if ( ! empty($metadatas)) {
foreach ($metadatas as $metadata) {
$output->write(
sprintf('Processing entity "<info>%s</info>"', $metadata->name) . PHP_EOL
......
......@@ -23,7 +23,8 @@ namespace Doctrine\ORM\Tools\Console\Command;
use Symfony\Components\Console\Input\InputArgument,
Symfony\Components\Console\Input\InputOption,
Symfony\Components\Console;
Symfony\Components\Console,
Doctrine\ORM\Tools\Console\MetadataFilter;
/**
* Command to (re)generate the proxy classes used by doctrine.
......@@ -48,18 +49,14 @@ class GenerateProxiesCommand extends Console\Command\Command
->setName('orm:generate-proxies')
->setDescription('Generates proxy classes for entity classes.')
->setDefinition(array(
new InputArgument(
'from-path', InputArgument::REQUIRED, 'The path of mapping information.'
new InputOption(
'filter', null, InputOption::PARAMETER_REQUIRED | InputOption::PARAMETER_IS_ARRAY,
'A string pattern used to match entities that should be processed.'
),
new InputArgument(
'dest-path', InputArgument::OPTIONAL,
'The path to generate your proxy classes. If none is provided, it will attempt to grab from configuration.'
),
new InputOption(
'from', null, InputOption::PARAMETER_REQUIRED | InputOption::PARAMETER_IS_ARRAY,
'Optional paths of mapping information.',
array()
)
))
->setHelp(<<<EOT
Generates proxy classes for entity classes.
......@@ -73,34 +70,19 @@ EOT
protected function execute(Console\Input\InputInterface $input, Console\Output\OutputInterface $output)
{
$em = $this->getHelper('em')->getEntityManager();
$reader = new ClassMetadataReader();
$reader->setEntityManager($em);
// Process source directories
$fromPaths = array_merge(array($input->getArgument('from-path')), $input->getOption('from'));
foreach ($fromPaths as $dirName) {
$dirName = realpath($dirName);
if ( ! file_exists($dirName)) {
throw new \InvalidArgumentException(
sprintf("Mapping directory '<info>%s</info>' does not exist.", $dirName)
);
} else if ( ! is_readable($dirName)) {
throw new \InvalidArgumentException(
sprintf("Mapping directory '<info>%s</info>' does not have read permissions.", $dirName)
);
}
$reader->addMappingSource($dirName);
}
$metadatas = $em->getMetadataFactory()->getAllMetadata();
$metadatas = MetadataFilter::filter($metadatas, $input->getOption('filter'));
// Process destination directory
if (($destPath = $input->getArgument('dest-path')) === null) {
$destPath = $em->getConfiguration()->getProxyDir();
}
if ( ! is_dir($destPath)) {
mkdir($destPath, 0777, true);
}
$destPath = realpath($destPath);
if ( ! file_exists($destPath)) {
......@@ -113,10 +95,7 @@ EOT
);
}
// Retrieving ClassMetadatas
$metadatas = $reader->getMetadatas();
if ( ! empty($metadatas)) {
if ( count($metadatas)) {
foreach ($metadatas as $metadata) {
$output->write(
sprintf('Processing entity "<info>%s</info>"', $metadata->name) . PHP_EOL
......
......@@ -23,7 +23,8 @@ namespace Doctrine\ORM\Tools\Console\Command;
use Symfony\Components\Console\Input\InputArgument,
Symfony\Components\Console\Input\InputOption,
Symfony\Components\Console;
Symfony\Components\Console,
Doctrine\ORM\Tools\Console\MetadataFilter;
/**
* Command to generate repository classes for mapping information.
......@@ -65,16 +66,12 @@ class <className> extends EntityRepository
->setName('orm:generate-repositories')
->setDescription('Generate repository classes from your mapping information.')
->setDefinition(array(
new InputArgument(
'from-path', InputArgument::REQUIRED, 'The path of mapping information.'
new InputOption(
'filter', null, InputOption::PARAMETER_REQUIRED | InputOption::PARAMETER_IS_ARRAY,
'A string pattern used to match entities that should be processed.'
),
new InputArgument(
'dest-path', InputArgument::REQUIRED, 'The path to generate your repository classes.'
),
new InputOption(
'from', null, InputOption::PARAMETER_REQUIRED | InputOption::PARAMETER_IS_ARRAY,
'Optional paths of mapping information.',
array()
)
))
->setHelp(<<<EOT
......@@ -89,28 +86,9 @@ EOT
protected function execute(Console\Input\InputInterface $input, Console\Output\OutputInterface $output)
{
$em = $this->getHelper('em')->getEntityManager();
$reader = new ClassMetadataReader();
$reader->setEntityManager($em);
// Process source directories
$fromPaths = array_merge(array($input->getArgument('from-path')), $input->getOption('from'));
foreach ($fromPaths as $dirName) {
$dirName = realpath($dirName);
if ( ! file_exists($dirName)) {
throw new \InvalidArgumentException(
sprintf("Mapping directory '<info>%s</info>' does not exist.", $dirName)
);
} else if ( ! is_readable($dirName)) {
throw new \InvalidArgumentException(
sprintf("Mapping directory '<info>%s</info>' does not have read permissions.", $dirName)
);
}
$reader->addMappingSource($dirName);
}
$metadatas = $em->getMetadataFactory()->getAllMetadata();
$metadatas = MetadataFilter::filter($metadatas, $input->getOption('filter'));
// Process destination directory
$destPath = realpath($input->getArgument('dest-path'));
......@@ -125,10 +103,7 @@ EOT
);
}
// Retrieving ClassMetadatas
$metadatas = $reader->getMetadatas();
if ( ! empty($metadatas)) {
if ( count($metadatas)) {
$numRepositories = 0;
foreach ($metadatas as $metadata) {
......
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace Doctrine\ORM\Tools\Console\Command\SchemaTool;
use Symfony\Components\Console\Input\InputArgument,
Symfony\Components\Console\Input\InputOption,
Symfony\Components\Console\Input\InputInterface,
Symfony\Components\Console\Output\OutputInterface,
Symfony\Components\Console\Command\Command,
Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper,
Doctrine\ORM\Tools\SchemaTool,
Doctrine\ORM\Mapping\Driver\AbstractFileDriver;
abstract class AbstractCommand extends Command
{
/**
* @param InputInterface $input
* @param OutputInterface $output
* @param SchemaTool $schemaTool
* @param array $metadatas
*/
abstract protected function executeSchemaCommand(InputInterface $input, OutputInterface $output, SchemaTool $schemaTool, array $metadatas);
/**
* @see Console\Command\Command
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$emHelper = $this->getHelper('em');
/* @var $em \Doctrine\ORM\EntityManager */
$em = $emHelper->getEntityManager();
$metadatas = $em->getMetadataFactory()->getAllMetadata();
if ( ! empty($metadatas)) {
// Create SchemaTool
$tool = new \Doctrine\ORM\Tools\SchemaTool($em);
$this->executeSchemaCommand($input, $output, $tool, $metadatas);
} else {
$output->write('No Metadata Classes to process.' . PHP_EOL);
}
}
}
\ No newline at end of file
......@@ -23,7 +23,9 @@ namespace Doctrine\ORM\Tools\Console\Command\SchemaTool;
use Symfony\Components\Console\Input\InputArgument,
Symfony\Components\Console\Input\InputOption,
Symfony\Components\Console;
Symfony\Components\Console\Input\InputInterface,
Symfony\Components\Console\Output\OutputInterface,
Doctrine\ORM\Tools\SchemaTool;
/**
* Command to create the database schema for a set of classes based on their mappings.
......@@ -37,7 +39,7 @@ use Symfony\Components\Console\Input\InputArgument,
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class CreateCommand extends Console\Command\Command
class CreateCommand extends AbstractCommand
{
/**
* @see Console\Command\Command
......@@ -50,14 +52,6 @@ class CreateCommand extends Console\Command\Command
'Processes the schema and either create it directly on EntityManager Storage Connection or generate the SQL output.'
)
->setDefinition(array(
new InputArgument(
'from-path', InputArgument::REQUIRED, 'The path of mapping information.'
),
new InputOption(
'from', null, InputOption::PARAMETER_REQUIRED | InputOption::PARAMETER_IS_ARRAY,
'Optional paths of mapping information.',
array()
),
new InputOption(
'dump-sql', null, InputOption::PARAMETER_NONE,
'Instead of try to apply generated SQLs into EntityManager Storage Connection, output them.'
......@@ -69,52 +63,15 @@ EOT
);
}
/**
* @see Console\Command\Command
*/
protected function execute(Console\Input\InputInterface $input, Console\Output\OutputInterface $output)
protected function executeSchemaCommand(InputInterface $input, OutputInterface $output, SchemaTool $schemaTool, array $metadatas)
{
$em = $this->getHelper('em')->getEntityManager();
$reader = new \Doctrine\ORM\Tools\ClassMetadataReader();
$reader->setEntityManager($em);
// Process source directories
$fromPaths = array_merge(array($input->getArgument('from-path')), $input->getOption('from'));
foreach ($fromPaths as $dirName) {
$dirName = realpath($dirName);
if ( ! file_exists($dirName)) {
throw new \InvalidArgumentException(
sprintf("Mapping directory '<info>%s</info>' does not exist.", $dirName)
);
} else if ( ! is_readable($dirName)) {
throw new \InvalidArgumentException(
sprintf("Mapping directory '<info>%s</info>' does not have read permissions.", $dirName)
);
}
$reader->addMappingSource($dirName);
}
// Retrieving ClassMetadatas
$metadatas = $reader->getMetadatas();
if ( ! empty($metadatas)) {
// Create SchemaTool
$tool = new \Doctrine\ORM\Tools\SchemaTool($em);
if ($input->getOption('dump-sql') === null) {
$sqls = $tool->getCreateSchemaSql($metadatas);
$output->write(implode(';' . PHP_EOL, $sqls));
} else {
$output->write('Creating database schema...' . PHP_EOL);
$tool->createSchema($metadatas);
$output->write('Database schema created successfully!' . PHP_EOL);
}
if ($input->getOption('dump-sql') === true) {
$sqls = $schemaTool->getCreateSchemaSql($metadatas);
$output->write(implode(';' . PHP_EOL, $sqls) . PHP_EOL);
} else {
$output->write('No Metadata Classes to process.' . PHP_EOL);
$output->write('Creating database schema...' . PHP_EOL);
$schemaTool->createSchema($metadatas);
$output->write('Database schema created successfully!' . PHP_EOL);
}
}
}
\ No newline at end of file
......@@ -23,7 +23,9 @@ namespace Doctrine\ORM\Tools\Console\Command\SchemaTool;
use Symfony\Components\Console\Input\InputArgument,
Symfony\Components\Console\Input\InputOption,
Symfony\Components\Console;
Symfony\Components\Console\Input\InputInterface,
Symfony\Components\Console\Output\OutputInterface,
Doctrine\ORM\Tools\SchemaTool;
/**
* Command to drop the database schema for a set of classes based on their mappings.
......@@ -37,7 +39,7 @@ use Symfony\Components\Console\Input\InputArgument,
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class DropCommand extends Console\Command\Command
class DropCommand extends AbstractCommand
{
/**
* @see Console\Command\Command
......@@ -50,14 +52,6 @@ class DropCommand extends Console\Command\Command
'Processes the schema and either drop the database schema of EntityManager Storage Connection or generate the SQL output.'
)
->setDefinition(array(
new InputArgument(
'from-path', InputArgument::REQUIRED, 'The path of mapping information.'
),
new InputOption(
'from', null, InputOption::PARAMETER_REQUIRED | InputOption::PARAMETER_IS_ARRAY,
'Optional paths of mapping information.',
array()
),
new InputOption(
'dump-sql', null, InputOption::PARAMETER_NONE,
'Instead of try to apply generated SQLs into EntityManager Storage Connection, output them.'
......@@ -70,52 +64,15 @@ EOT
);
}
/**
* @see Console\Command\Command
*/
protected function execute(Console\Input\InputInterface $input, Console\Output\OutputInterface $output)
protected function executeSchemaCommand(InputInterface $input, OutputInterface $output, SchemaTool $schemaTool, array $metadatas)
{
$em = $this->getHelper('em')->getEntityManager();
$reader = new \Doctrine\ORM\Tools\ClassMetadataReader();
$reader->setEntityManager($em);
// Process source directories
$fromPaths = array_merge(array($input->getArgument('from-path')), $input->getOption('from'));
foreach ($fromPaths as $dirName) {
$dirName = realpath($dirName);
if ( ! file_exists($dirName)) {
throw new \InvalidArgumentException(
sprintf("Mapping directory '<info>%s</info>' does not exist.", $dirName)
);
} else if ( ! is_readable($dirName)) {
throw new \InvalidArgumentException(
sprintf("Mapping directory '<info>%s</info>' does not have read permissions.", $dirName)
);
}
$reader->addMappingSource($dirName);
}
// Retrieving ClassMetadatas
$metadatas = $reader->getMetadatas();
if ( ! empty($metadatas)) {
// Create SchemaTool
$tool = new \Doctrine\ORM\Tools\SchemaTool($em);
if ($input->getOption('dump-sql') === null) {
$sqls = $tool->getDropSchemaSql($metadatas);
$output->write(implode(';' . PHP_EOL, $sqls));
} else {
$output->write('Dropping database schema...' . PHP_EOL);
$tool->dropSchema($metadatas);
$output->write('Database schema dropped successfully!' . PHP_EOL);
}
if ($input->getOption('dump-sql') === true) {
$sqls = $schemaTool->getDropSchemaSql($metadatas);
$output->write(implode(';' . PHP_EOL, $sqls) . PHP_EOL);
} else {
$output->write('No Metadata Classes to process.' . PHP_EOL);
$output->write('Dropping database schema...' . PHP_EOL);
$schemaTool->dropSchema($metadatas);
$output->write('Database schema dropped successfully!' . PHP_EOL);
}
}
}
\ No newline at end of file
......@@ -23,7 +23,9 @@ namespace Doctrine\ORM\Tools\Console\Command\SchemaTool;
use Symfony\Components\Console\Input\InputArgument,
Symfony\Components\Console\Input\InputOption,
Symfony\Components\Console;
Symfony\Components\Console\Input\InputInterface,
Symfony\Components\Console\Output\OutputInterface,
Doctrine\ORM\Tools\SchemaTool;
/**
* Command to update the database schema for a set of classes based on their mappings.
......@@ -37,7 +39,7 @@ use Symfony\Components\Console\Input\InputArgument,
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class UpdateCommand extends Console\Command\Command
class UpdateCommand extends AbstractCommand
{
/**
* @see Console\Command\Command
......@@ -50,14 +52,6 @@ class UpdateCommand extends Console\Command\Command
'Processes the schema and either update the database schema of EntityManager Storage Connection or generate the SQL output.'
)
->setDefinition(array(
new InputArgument(
'from-path', InputArgument::REQUIRED, 'The path of mapping information.'
),
new InputOption(
'from', null, InputOption::PARAMETER_REQUIRED | InputOption::PARAMETER_IS_ARRAY,
'Optional paths of mapping information.',
array()
),
new InputOption(
'complete', null, InputOption::PARAMETER_NONE,
'If defined, all assets of the database which are not relevant to the current metadata will be dropped.'
......@@ -75,55 +69,18 @@ EOT
);
}
/**
* @see Console\Command\Command
*/
protected function execute(Console\Input\InputInterface $input, Console\Output\OutputInterface $output)
protected function executeSchemaCommand(InputInterface $input, OutputInterface $output, SchemaTool $schemaTool, array $metadatas)
{
$em = $this->getHelper('em')->getEntityManager();
$reader = new \Doctrine\ORM\Tools\ClassMetadataReader();
$reader->setEntityManager($em);
// Process source directories
$fromPaths = array_merge(array($input->getArgument('from-path')), $input->getOption('from'));
foreach ($fromPaths as $dirName) {
$dirName = realpath($dirName);
if ( ! file_exists($dirName)) {
throw new \InvalidArgumentException(
sprintf("Mapping directory '<info>%s</info>' does not exist.", $dirName)
);
} else if ( ! is_readable($dirName)) {
throw new \InvalidArgumentException(
sprintf("Mapping directory '<info>%s</info>' does not have read permissions.", $dirName)
);
}
$reader->addMappingSource($dirName);
}
// Defining if update is complete or not (--complete not defined means $saveMode = true)
$saveMode = ($input->getOption('complete') === null);
// Retrieving ClassMetadatas
$metadatas = $reader->getMetadatas();
if ( ! empty($metadatas)) {
// Create SchemaTool
$tool = new \Doctrine\ORM\Tools\SchemaTool($em);
$saveMode = ($input->getOption('complete') === true);
if ($input->getOption('dump-sql') === null) {
$sqls = $tool->getUpdateSchemaSql($metadatas, $saveMode);
$output->write(implode(';' . PHP_EOL, $sqls));
} else {
$output->write('Updating database schema...' . PHP_EOL);
$tool->updateSchema($metadatas, $saveMode);
$output->write('Database schema updated successfully!' . PHP_EOL);
}
if ($input->getOption('dump-sql') === true) {
$sqls = $schemaTool->getUpdateSchemaSql($metadatas, $saveMode);
$output->write(implode(';' . PHP_EOL, $sqls) . PHP_EOL);
} else {
$output->write('No Metadata Classes to process.' . PHP_EOL);
$output->write('Updating database schema...' . PHP_EOL);
$schemaTool->updateSchema($metadatas, $saveMode);
$output->write('Database schema updated successfully!' . PHP_EOL);
}
}
}
\ No newline at end of file
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace Doctrine\ORM\Tools\Console;
/**
* Used by CLI Tools to restrict entity-based commands to given patterns.
*
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.com
* @since 1.0
* @version $Revision$
* @author Benjamin Eberlei <kontakt@beberlei.de>
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class MetadataFilter extends \FilterIterator implements \Countable
{
/**
* Filter Metadatas by one or more filter options.
*
* @param array $metadatas
* @param array|string $filter
* @return array
*/
static public function filter(array $metadatas, $filter)
{
$metadatas = new MetadataFilter(new \ArrayIterator($metadatas), $filter);
return iterator_to_array($metadatas);
}
private $_filter = array();
public function __construct(\ArrayIterator $metadata, $filter)
{
$this->_filter = (array)$filter;
parent::__construct($metadata);
}
public function accept()
{
if (count($this->_filter) == 0) {
return true;
}
$it = $this->getInnerIterator();
$metadata = $it->current();
foreach ($this->_filter AS $filter) {
if (strpos($metadata->name, $filter) !== false) {
return true;
}
}
return false;
}
public function count()
{
return count($this->getInnerIterator());
}
}
\ No newline at end of file
......@@ -62,7 +62,7 @@ class ConvertDoctrine1Schema
*
* @return array $metadatas An array of ClassMetadataInfo instances
*/
public function getMetadatas()
public function getMetadata()
{
$schema = array();
foreach ($this->_from as $path) {
......
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace Doctrine\ORM\Tools;
use Doctrine\ORM\Mapping\ClassMetadataFactory;
use Doctrine\ORM\Mapping\ClassMetadataInfo;
/**
* The DisconnectedClassMetadataFactory is used to create ClassMetadataInfo objects
* that do not require the entity class actually exist. This allows us to
* load some mapping information and use it to do things like generate code
* from the mapping information.
*
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision$
* @author Benjamin Eberlei <kontakt@beberlei.de>
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class DisconnectedClassMetadataFactory extends ClassMetadataFactory
{
/**
* @override
*/
protected function _newClassMetadataInstance($className)
{
return new ClassMetadataInfo($className);
}
/**
* @override
*/
protected function _getParentClasses($name)
{
return array();
}
}
\ No newline at end of file
......@@ -933,6 +933,9 @@ public function <methodName>()
case ClassMetadataInfo::GENERATOR_TYPE_IDENTITY:
return 'IDENTITY';
case ClassMetadataInfo::GENERATOR_TYPE_NONE:
return 'NONE';
default:
throw new \InvalidArgumentException('Invalid provided IdGeneratorType: ' . $type);
}
......
......@@ -22,29 +22,13 @@
namespace Doctrine\ORM\Tools\Export;
use Doctrine\ORM\Tools\ClassMetadataReader,
Doctrine\ORM\Tools\Export\ExportException,
use Doctrine\ORM\Tools\Export\ExportException,
Doctrine\ORM\EntityManager;
/**
* Class used for converting your mapping information between the
* supported formats: yaml, xml, and php/annotation.
*
* [php]
* // Unify all your mapping information which is written in php, xml, yml
* // and convert it to a single set of yaml files.
*
* $cme = new Doctrine\ORM\Tools\Export\ClassMetadataExporter();
* $cme->addMappingSource(__DIR__ . '/Entities');
* $cme->addMappingSource(__DIR__ . '/xml');
* $cme->addMappingSource(__DIR__ . '/yaml');
*
* $exporter = $cme->getExporter('yaml');
* $exporter->setOutputDir(__DIR__ . '/new_yaml');
*
* $exporter->setMetadatas($cme->getMetadatas());
* $exporter->export();
*
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
......@@ -61,11 +45,6 @@ class ClassMetadataExporter
'annotation' => 'Doctrine\ORM\Tools\Export\Driver\AnnotationExporter'
);
public function __construct()
{
$this->_reader = new ClassMetadataReader();
}
/**
* Register a new exporter driver class under a specified name
*
......@@ -77,18 +56,6 @@ class ClassMetadataExporter
self::$_exporterDrivers[$name] = $class;
}
/**
* Optionally set the EntityManager instance to get the AnnotationDriver
* from instead of creating a new instance of the AnnotationDriver
*
* @param EntityManager $em
* @return void
*/
public function setEntityManager(EntityManager $em)
{
$this->_reader->setEntityManager($em);
}
/**
* Get a exporter driver instance
*
......@@ -96,7 +63,7 @@ class ClassMetadataExporter
* @param string $source The directory where the exporter will export to
* @return AbstractExporter $exporter
*/
public function getExporter($type, $source = null)
public function getExporter($type, $dest)
{
if ( ! isset(self::$_exporterDrivers[$type])) {
throw ExportException::invalidExporterDriverType($type);
......@@ -104,36 +71,6 @@ class ClassMetadataExporter
$class = self::$_exporterDrivers[$type];
return new $class($source);
}
/**
* Add a new mapping directory to the array of directories to convert and export
* to another format
*
* [php]
* $cme = new Doctrine\ORM\Tools\Export\ClassMetadataExporter();
* $cme->addMappingSource(__DIR__ . '/yaml');
* $cme->addMappingSource($schemaManager);
*
* @param string $source The source for the mapping files
* @param string $type The type of mapping files (yml, xml, etc.)
* @return void
*/
public function addMappingSource($source, $type = null)
{
$this->_reader->addMappingSource($source, $type);
}
/**
* Get an array of ClassMetadataInfo instances for all the configured mapping
* directories. Reads the mapping directories and populates ClassMetadataInfo
* instances.
*
* @return array $classes
*/
public function getMetadatas()
{
return $this->_reader->getMetadatas();
return new $class($dest);
}
}
\ No newline at end of file
......@@ -36,7 +36,7 @@ use Doctrine\ORM\Mapping\ClassMetadataInfo;
*/
abstract class AbstractExporter
{
protected $_metadatas = array();
protected $_metadata = array();
protected $_outputDir;
protected $_extension;
......@@ -57,12 +57,12 @@ abstract class AbstractExporter
/**
* Set the array of ClassMetadataInfo instances to export
*
* @param array $metadatas
* @param array $metadata
* @return void
*/
public function setMetadatas(array $metadatas)
public function setMetadata(array $metadata)
{
$this->_metadatas = $metadatas;
$this->_metadata = $metadata;
}
/**
......@@ -79,7 +79,7 @@ abstract class AbstractExporter
* Set the directory to output the mapping files to
*
* [php]
* $exporter = new YamlExporter($metadatas);
* $exporter = new YamlExporter($metadata);
* $exporter->setOutputDir(__DIR__ . '/yaml');
* $exporter->export();
*
......@@ -103,7 +103,7 @@ abstract class AbstractExporter
mkdir($this->_outputDir, 0777, true);
}
foreach ($this->_metadatas as $metadata) {
foreach ($this->_metadata as $metadata) {
$output = $this->exportClassMetadata($metadata);
$path = $this->_generateOutputPath($metadata);
$dir = dirname($path);
......@@ -129,7 +129,7 @@ abstract class AbstractExporter
* Set the directory to output the mapping files to
*
* [php]
* $exporter = new YamlExporter($metadatas, __DIR__ . '/yaml');
* $exporter = new YamlExporter($metadata, __DIR__ . '/yaml');
* $exporter->setExtension('.yml');
* $exporter->export();
*
......
......@@ -347,7 +347,7 @@ class SchemaTool
private function _gatherRelationsSql($class, $table, $schema)
{
foreach ($class->associationMappings as $fieldName => $mapping) {
if (isset($class->inheritedAssociationFields[$fieldName])) {
if ($mapping->inherited) {
continue;
}
......
This diff is collapsed.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta name="generator" content="PHPDoctor 2RC4 (http://phpdoctor.sourceforge.net/)">
<meta name="when" content="Wed, 14 Apr 2010 15:12:06 +0000">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<link rel="start" href="overview-summary.html">
<title>Deprecated (Doctrine)</title>
</head>
<body id="overview" onload="parent.document.title=document.title;">
<div class="header">
<h1>Doctrine</h1>
<ul>
<li><a href="overview-summary.html">Overview</a></li>
<li>Namespace</li><li>Class</li><li><a href="overview-tree.html">Tree</a></li>
<li class="active">Deprecated</li>
<li><a href="index-all.html">Index</a></li>
</ul>
</div>
<div class="small_links">
<a href="index.html" target="_top">Frames</a>
<a href="deprecated-list.html" target="_top">No frames</a>
</div>
<h1>Deprecated API</h1><hr>
<h2>Contents</h2>
<ul>
<li><a href="#deprecated_method">Deprecated Methods</a></li></ul>
<table id="deprecated_method" class="detail">
<tr><th colspan="2" class="title">Deprecated Methods</th></tr>
<tr>
<td class="name"><a href="doctrine/orm/mapping/classmetadatainfo.html#setTableName()">Doctrine\ORM\Mapping\ClassMetadataInfo\setTableName</a></td>
<td class="description">Sets the name of the primary table the class is mapped to.</td>
</tr>
</table>
<div class="header">
<h1>Doctrine</h1>
<ul>
<li><a href="overview-summary.html">Overview</a></li>
<li>Namespace</li><li>Class</li><li><a href="overview-tree.html">Tree</a></li>
<li class="active">Deprecated</li>
<li><a href="index-all.html">Index</a></li>
</ul>
</div>
<div class="small_links">
<a href="index.html" target="_top">Frames</a>
<a href="deprecated-list.html" target="_top">No frames</a>
</div>
<hr>
<p id="footer">This document was generated by <a href="http://peej.github.com/phpdoctor/">PHPDoctor: The PHP Documentation Creator</a></p>
</body>
</html>
\ No newline at end of file
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta name="generator" content="PHPDoctor 2RC4 (http://phpdoctor.sourceforge.net/)">
<meta name="when" content="Wed, 14 Apr 2010 15:12:03 +0000">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css">
<link rel="start" href="../../../overview-summary.html">
<title>Annotation (Doctrine)</title>
</head>
<body id="definition" onload="parent.document.title=document.title;">
<div class="header">
<h1>Doctrine</h1>
<ul>
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="../../../doctrine/common/annotations/package-summary.html">Namespace</a></li>
<li class="active">Class</li>
<li><a href="../../../doctrine/common/annotations/package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-all.html">Index</a></li>
</ul>
</div>
<div class="small_links">
<a href="../../../index.html" target="_top">Frames</a>
<a href="../../../doctrine/common/annotations/annotation.html" target="_top">No frames</a>
</div>
<div class="small_links">
Summary: <a href="#summary_field">Field</a> | <a href="#summary_method">Method</a> | <a href="#summary_constr">Constr</a>
Detail: <a href="#detail_field">Field</a> | <a href="#detail_method">Method</a> | <a href="#summary_constr">Constr</a>
</div>
<hr>
<div class="qualifiedName">Doctrine\Common\Annotations\Annotation</div>
<div class="location">/Doctrine/Common/Annotations/Annotation.php at line 35</div>
<h1>Class Annotation</h1>
<pre class="tree"><strong>Annotation</strong><br /></pre>
<hr>
<p class="signature">public class <strong>Annotation</strong></p>
<div class="comment" id="overview_description"><p>Annotations class</p></div>
<dl>
<dt>License:</dt>
<dd>http://www.opensource.org/licenses/lgpl-license.php LGPL</dd>
<dt>See Also:</dt>
<dd><code>www.doctrine-project.org</code></dd>
<dt>Since:</dt>
<dd>2.0</dd>
<dt>Version:</dt>
<dd>$Revision: 3938 $</dd>
<dt>Author:</dt>
<dd>Guilherme Blanco <guilhermeblanco@hotmail.com></dd>
<dd>Jonathan Wage <jonwage@gmail.com></dd>
<dd>Roman Borschel <roman@code-factory.org></dd>
</dl>
<hr>
<table id="summary_field">
<tr><th colspan="2">Field Summary</th></tr>
<tr>
<td class="type"> string</td>
<td class="description"><p class="name"><a href="#value">$value</a></p><p class="description">Value property. </p></td>
</tr>
</table>
<table id="summary_constr">
<tr><th colspan="2">Constructor Summary</th></tr>
<tr>
<td class="description"><p class="name"><a href="#Annotation()">Annotation</a>(array data)</p><p class="description">Constructor</p></td>
</tr>
</table>
<h2 id="detail_field">Field Detail</h2>
<div class="location">/Doctrine/Common/Annotations/Annotation.php at line 42</div>
<h3 id="value">value</h3>
<code class="signature">public string <strong>$value</strong></code>
<div class="details">
<p>Value property. Common among all derived classes.</p></div>
<hr>
<h2 id="detail_constr">Constructor Detail</h2>
<div class="location">/Doctrine/Common/Annotations/Annotation.php at line 49</div>
<h3 id="Annotation()">Annotation</h3>
<code class="signature">public <strong>Annotation</strong>(array data)</code>
<div class="details">
<p>Constructor</p><dl>
<dt>Parameters:</dt>
<dd>data - Key-value for properties to be defined in this class</dd>
</dl>
</div>
<hr>
<div class="header">
<h1>Doctrine</h1>
<ul>
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="../../../doctrine/common/annotations/package-summary.html">Namespace</a></li>
<li class="active">Class</li>
<li><a href="../../../doctrine/common/annotations/package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-all.html">Index</a></li>
</ul>
</div>
<div class="small_links">
<a href="../../../index.html" target="_top">Frames</a>
<a href="../../../doctrine/common/annotations/annotation.html" target="_top">No frames</a>
</div>
<div class="small_links">
Summary: <a href="#summary_field">Field</a> | <a href="#summary_method">Method</a> | <a href="#summary_constr">Constr</a>
Detail: <a href="#detail_field">Field</a> | <a href="#detail_method">Method</a> | <a href="#summary_constr">Constr</a>
</div>
<hr>
<p id="footer">This document was generated by <a href="http://peej.github.com/phpdoctor/">PHPDoctor: The PHP Documentation Creator</a></p>
</body>
</html>
\ No newline at end of file
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta name="generator" content="PHPDoctor 2RC4 (http://phpdoctor.sourceforge.net/)">
<meta name="when" content="Wed, 14 Apr 2010 15:12:03 +0000">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css">
<link rel="start" href="../../../overview-summary.html">
<title>AnnotationException (Doctrine)</title>
</head>
<body id="definition" onload="parent.document.title=document.title;">
<div class="header">
<h1>Doctrine</h1>
<ul>
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="../../../doctrine/common/annotations/package-summary.html">Namespace</a></li>
<li class="active">Class</li>
<li><a href="../../../doctrine/common/annotations/package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-all.html">Index</a></li>
</ul>
</div>
<div class="small_links">
<a href="../../../index.html" target="_top">Frames</a>
<a href="../../../doctrine/common/annotations/annotationexception.html" target="_top">No frames</a>
</div>
<div class="small_links">
Summary: <a href="#summary_field">Field</a> | <a href="#summary_method">Method</a> | <a href="#summary_constr">Constr</a>
Detail: <a href="#detail_field">Field</a> | <a href="#detail_method">Method</a> | <a href="#summary_constr">Constr</a>
</div>
<hr>
<div class="qualifiedName">Doctrine\Common\Annotations\AnnotationException</div>
<div class="location">/Doctrine/Common/Annotations/AnnotationException.php at line 35</div>
<h1>Class AnnotationException</h1>
<pre class="tree">Class:AnnotationException - Superclass: Doctrine
Doctrine<br>&lfloor;&nbsp;<strong>AnnotationException</strong><br /></pre>
<hr>
<p class="signature">public class <strong>AnnotationException</strong><br>extends Doctrine
</p>
<div class="comment" id="overview_description"><p>Description of AnnotationException</p></div>
<dl>
<dt>License:</dt>
<dd>http://www.opensource.org/licenses/lgpl-license.php LGPL</dd>
<dt>See Also:</dt>
<dd><code>www.doctrine-project.org</code></dd>
<dt>Since:</dt>
<dd>2.0</dd>
<dt>Version:</dt>
<dd>$Revision: 3938 $</dd>
<dt>Author:</dt>
<dd>Guilherme Blanco <guilhermeblanco@hotmail.com></dd>
<dd>Jonathan Wage <jonwage@gmail.com></dd>
<dd>Roman Borschel <roman@code-factory.org></dd>
</dl>
<hr>
<table id="summary_method">
<tr><th colspan="2">Method Summary</th></tr>
<tr>
<td class="type">static void</td>
<td class="description"><p class="name"><a href="#semanticalError()">semanticalError</a>(mixed message)</p></td>
</tr>
<tr>
<td class="type">static void</td>
<td class="description"><p class="name"><a href="#syntaxError()">syntaxError</a>(mixed message)</p></td>
</tr>
</table>
<h2 id="detail_method">Method Detail</h2>
<div class="location">/Doctrine/Common/Annotations/AnnotationException.php at line 43</div>
<h3 id="semanticalError()">semanticalError</h3>
<code class="signature">public static void <strong>semanticalError</strong>(mixed message)</code>
<div class="details">
</div>
<hr>
<div class="location">/Doctrine/Common/Annotations/AnnotationException.php at line 37</div>
<h3 id="syntaxError()">syntaxError</h3>
<code class="signature">public static void <strong>syntaxError</strong>(mixed message)</code>
<div class="details">
</div>
<hr>
<div class="header">
<h1>Doctrine</h1>
<ul>
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="../../../doctrine/common/annotations/package-summary.html">Namespace</a></li>
<li class="active">Class</li>
<li><a href="../../../doctrine/common/annotations/package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-all.html">Index</a></li>
</ul>
</div>
<div class="small_links">
<a href="../../../index.html" target="_top">Frames</a>
<a href="../../../doctrine/common/annotations/annotationexception.html" target="_top">No frames</a>
</div>
<div class="small_links">
Summary: <a href="#summary_field">Field</a> | <a href="#summary_method">Method</a> | <a href="#summary_constr">Constr</a>
Detail: <a href="#detail_field">Field</a> | <a href="#detail_method">Method</a> | <a href="#summary_constr">Constr</a>
</div>
<hr>
<p id="footer">This document was generated by <a href="http://peej.github.com/phpdoctor/">PHPDoctor: The PHP Documentation Creator</a></p>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta name="generator" content="PHPDoctor 2RC4 (http://phpdoctor.sourceforge.net/)">
<meta name="when" content="Wed, 14 Apr 2010 15:12:03 +0000">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css">
<link rel="start" href="../../../overview-summary.html">
<title>Doctrine\Common\Annotations (Doctrine)</title>
</head>
<body id="frame">
<h1><a href="package-summary.html" target="main">Doctrine\Common\Annotations</a></h1>
<h2>Classes</h2>
<ul>
<li><a href="../../../doctrine/common/annotations/annotation.html" target="main">Annotation</a></li>
<li><a href="../../../doctrine/common/annotations/annotationexception.html" target="main">AnnotationException</a></li>
<li><a href="../../../doctrine/common/annotations/annotationreader.html" target="main">AnnotationReader</a></li>
<li><a href="../../../doctrine/common/annotations/lexer.html" target="main">Lexer</a></li>
<li><a href="../../../doctrine/common/annotations/parser.html" target="main">Parser</a></li>
</ul>
</body>
</html>
\ No newline at end of file
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta name="generator" content="PHPDoctor 2RC4 (http://phpdoctor.sourceforge.net/)">
<meta name="when" content="Wed, 14 Apr 2010 15:12:06 +0000">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css">
<link rel="start" href="../../../overview-summary.html">
<title>Functions (Doctrine)</title>
</head>
<body id="definition" onload="parent.document.title=document.title;">
<div class="header">
<h1>Doctrine</h1>
<ul>
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="../../../doctrine/common/annotations/package-summary.html">Package</a></li>
<li class="active">Function</li>
<li><a href="../../../overview-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-all.html">Index</a></li>
</ul>
</div>
<div class="small_links">
<a href="../../../index.html" target="_top">Frames</a>
<a href="../../../doctrine/common/annotations/package-functions.html" target="_top">No frames</a>
</div>
<div class="small_links">
Summary: <a href="#summary_function">Function</a>
Detail: <a href="#detail_function">Function</a>
</div>
<hr>
<h1>Functions</h1>
<hr>
<div class="header">
<h1>Doctrine</h1>
<ul>
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="../../../doctrine/common/annotations/package-summary.html">Package</a></li>
<li class="active">Function</li>
<li><a href="../../../overview-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-all.html">Index</a></li>
</ul>
</div>
<div class="small_links">
<a href="../../../index.html" target="_top">Frames</a>
<a href="../../../doctrine/common/annotations/package-functions.html" target="_top">No frames</a>
</div>
<div class="small_links">
Summary: <a href="#summary_function">Function</a>
Detail: <a href="#detail_function">Function</a>
</div>
<hr>
<p id="footer">This document was generated by <a href="http://peej.github.com/phpdoctor/">PHPDoctor: The PHP Documentation Creator</a></p>
</body>
</html>
\ No newline at end of file
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta name="generator" content="PHPDoctor 2RC4 (http://phpdoctor.sourceforge.net/)">
<meta name="when" content="Wed, 14 Apr 2010 15:12:06 +0000">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css">
<link rel="start" href="../../../overview-summary.html">
<title>Globals (Doctrine)</title>
</head>
<body id="definition" onload="parent.document.title=document.title;">
<div class="header">
<h1>Doctrine</h1>
<ul>
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="../../../doctrine/common/annotations/package-summary.html">Package</a></li>
<li class="active">Global</li>
<li><a href="../../../overview-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-all.html">Index</a></li>
</ul>
</div>
<div class="small_links">
<a href="../../../index.html" target="_top">Frames</a>
<a href="../../../doctrine/common/annotations/package-globals.html" target="_top">No frames</a>
</div>
<div class="small_links">
Summary: <a href="#summary_global">Global</a>
Detail: <a href="#detail_global">Global</a>
</div>
<hr>
<h1>Globals</h1>
<hr>
<div class="header">
<h1>Doctrine</h1>
<ul>
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="../../../doctrine/common/annotations/package-summary.html">Package</a></li>
<li class="active">Global</li>
<li><a href="../../../overview-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-all.html">Index</a></li>
</ul>
</div>
<div class="small_links">
<a href="../../../index.html" target="_top">Frames</a>
<a href="../../../doctrine/common/annotations/package-globals.html" target="_top">No frames</a>
</div>
<div class="small_links">
Summary: <a href="#summary_global">Global</a>
Detail: <a href="#detail_global">Global</a>
</div>
<hr>
<p id="footer">This document was generated by <a href="http://peej.github.com/phpdoctor/">PHPDoctor: The PHP Documentation Creator</a></p>
</body>
</html>
\ No newline at end of file
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta name="generator" content="PHPDoctor 2RC4 (http://phpdoctor.sourceforge.net/)">
<meta name="when" content="Wed, 14 Apr 2010 15:12:03 +0000">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css">
<link rel="start" href="../../../overview-summary.html">
<title>Doctrine\Common\Annotations (Doctrine)</title>
</head>
<body id="tree" onload="parent.document.title=document.title;">
<div class="header">
<h1>Doctrine</h1>
<ul>
<li><a href="../../../overview-summary.html">Overview</a></li>
<li class="active">Namespace</li>
<li>Class</li><li><a href="../../../doctrine/common/annotations/package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-all.html">Index</a></li>
</ul>
</div>
<div class="small_links">
<a href="../../../index.html" target="_top">Frames</a>
<a href="../../../doctrine/common/annotations/package-summary.html" target="_top">No frames</a>
</div>
<hr>
<h1>Namespace Doctrine\Common\Annotations</h1>
<table class="title">
<tr><th colspan="2" class="title">Class Summary</th></tr>
<tr><td class="name"><a href="../../../doctrine/common/annotations/annotation.html">Annotation</a></td><td class="description">Annotations class</td></tr>
<tr><td class="name"><a href="../../../doctrine/common/annotations/annotationexception.html">AnnotationException</a></td><td class="description">Description of AnnotationException</td></tr>
<tr><td class="name"><a href="../../../doctrine/common/annotations/annotationreader.html">AnnotationReader</a></td><td class="description">A reader for docblock annotations.</td></tr>
<tr><td class="name"><a href="../../../doctrine/common/annotations/lexer.html">Lexer</a></td><td class="description">Simple lexer for docblock annotations.</td></tr>
<tr><td class="name"><a href="../../../doctrine/common/annotations/parser.html">Parser</a></td><td class="description">A simple parser for docblock annotations.</td></tr>
</table>
<hr>
<div class="header">
<h1>Doctrine</h1>
<ul>
<li><a href="../../../overview-summary.html">Overview</a></li>
<li class="active">Namespace</li>
<li>Class</li><li><a href="../../../doctrine/common/annotations/package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-all.html">Index</a></li>
</ul>
</div>
<div class="small_links">
<a href="../../../index.html" target="_top">Frames</a>
<a href="../../../doctrine/common/annotations/package-summary.html" target="_top">No frames</a>
</div>
<hr>
<p id="footer">This document was generated by <a href="http://peej.github.com/phpdoctor/">PHPDoctor: The PHP Documentation Creator</a></p>
</body>
</html>
\ No newline at end of file
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta name="generator" content="PHPDoctor 2RC4 (http://phpdoctor.sourceforge.net/)">
<meta name="when" content="Wed, 14 Apr 2010 15:12:03 +0000">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css">
<link rel="start" href="../../../overview-summary.html">
<title>Doctrine\Common\Annotations (Doctrine)</title>
</head>
<body id="tree" onload="parent.document.title=document.title;">
<div class="header">
<h1>Doctrine</h1>
<ul>
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="../../../doctrine/common/annotations/package-summary.html">Namespace</a></li>
<li>Class</li><li class="active">Tree</li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-all.html">Index</a></li>
</ul>
</div>
<div class="small_links">
<a href="../../../index.html" target="_top">Frames</a>
<a href="../../../doctrine/common/annotations/package-tree.html" target="_top">No frames</a>
</div>
<h1>Class Hierarchy for Package Doctrine\Common\Annotations</h1><ul>
<li><a href="../../../doctrine/common/annotations/annotation.html">Doctrine\Common\Annotations\Annotation</a></li>
<li><a href="../../../doctrine/common/annotations/annotationreader.html">Doctrine\Common\Annotations\AnnotationReader</a></li>
<li><a href="../../../doctrine/common/annotations/parser.html">Doctrine\Common\Annotations\Parser</a></li>
</ul>
<div class="header">
<h1>Doctrine</h1>
<ul>
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="../../../doctrine/common/annotations/package-summary.html">Namespace</a></li>
<li>Class</li><li class="active">Tree</li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-all.html">Index</a></li>
</ul>
</div>
<div class="small_links">
<a href="../../../index.html" target="_top">Frames</a>
<a href="../../../doctrine/common/annotations/package-tree.html" target="_top">No frames</a>
</div>
<hr>
<p id="footer">This document was generated by <a href="http://peej.github.com/phpdoctor/">PHPDoctor: The PHP Documentation Creator</a></p>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta name="generator" content="PHPDoctor 2RC4 (http://phpdoctor.sourceforge.net/)">
<meta name="when" content="Wed, 14 Apr 2010 15:12:03 +0000">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css">
<link rel="start" href="../../../overview-summary.html">
<title>AbstractCache (Doctrine)</title>
</head>
<body id="definition" onload="parent.document.title=document.title;">
<div class="header">
<h1>Doctrine</h1>
<ul>
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="../../../doctrine/common/cache/package-summary.html">Namespace</a></li>
<li class="active">Class</li>
<li><a href="../../../doctrine/common/cache/package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-all.html">Index</a></li>
</ul>
</div>
<div class="small_links">
<a href="../../../index.html" target="_top">Frames</a>
<a href="../../../doctrine/common/cache/abstractcache.html" target="_top">No frames</a>
</div>
<div class="small_links">
Summary: <a href="#summary_field">Field</a> | <a href="#summary_method">Method</a> | <a href="#summary_constr">Constr</a>
Detail: <a href="#detail_field">Field</a> | <a href="#detail_method">Method</a> | <a href="#summary_constr">Constr</a>
</div>
<hr>
<div class="qualifiedName">Doctrine\Common\Cache\AbstractCache</div>
<div class="location">/Doctrine/Common/Cache/AbstractCache.php at line 35</div>
<h1>Class AbstractCache</h1>
<pre class="tree"><strong>AbstractCache</strong><br /></pre>
<hr>
<p class="signature">public abstract class <strong>AbstractCache</strong></p>
<div class="comment" id="overview_description"><p>Base class for cache driver implementations.</p></div>
<dl>
<dt>License:</dt>
<dd>http://www.opensource.org/licenses/lgpl-license.php LGPL</dd>
<dt>See Also:</dt>
<dd><code>www.doctrine-project.org</code></dd>
<dt>Since:</dt>
<dd>2.0</dd>
<dt>Version:</dt>
<dd>$Revision: 3938 $</dd>
<dt>Author:</dt>
<dd>Guilherme Blanco <guilhermeblanco@hotmail.com></dd>
<dd>Jonathan Wage <jonwage@gmail.com></dd>
<dd>Roman Borschel <roman@code-factory.org></dd>
</dl>
<hr>
<table id="summary_method">
<tr><th colspan="2">Method Summary</th></tr>
<tr>
<td class="type"> void</td>
<td class="description"><p class="name"><a href="#contains()">contains</a>(mixed id)</p><p class="description">{@inheritdoc}</p></td>
</tr>
<tr>
<td class="type"> void</td>
<td class="description"><p class="name"><a href="#delete()">delete</a>(mixed id)</p><p class="description">{@inheritdoc}</p></td>
</tr>
<tr>
<td class="type"> array</td>
<td class="description"><p class="name"><a href="#deleteAll()">deleteAll</a>()</p><p class="description">Delete all cache entries.</p></td>
</tr>
<tr>
<td class="type"> array</td>
<td class="description"><p class="name"><a href="#deleteByPrefix()">deleteByPrefix</a>(string prefix)</p><p class="description">Delete cache entries where the id has the passed prefix</p></td>
</tr>
<tr>
<td class="type"> array</td>
<td class="description"><p class="name"><a href="#deleteByRegex()">deleteByRegex</a>(string regex)</p><p class="description">Delete cache entries where the id matches a PHP regular expressions</p></td>
</tr>
<tr>
<td class="type"> array</td>
<td class="description"><p class="name"><a href="#deleteBySuffix()">deleteBySuffix</a>(string suffix)</p><p class="description">Delete cache entries where the id has the passed suffix</p></td>
</tr>
<tr>
<td class="type"> void</td>
<td class="description"><p class="name"><a href="#fetch()">fetch</a>(mixed id)</p><p class="description">{@inheritdoc}</p></td>
</tr>
<tr>
<td class="type">abstract array</td>
<td class="description"><p class="name"><a href="#getIds()">getIds</a>()</p><p class="description">Get an array of all the cache ids stored</p></td>
</tr>
<tr>
<td class="type"> void</td>
<td class="description"><p class="name"><a href="#save()">save</a>(mixed id, mixed data, mixed lifeTime)</p><p class="description">{@inheritdoc}</p></td>
</tr>
<tr>
<td class="type"> void</td>
<td class="description"><p class="name"><a href="#setNamespace()">setNamespace</a>(string namespace)</p><p class="description">Set the namespace to prefix all cache ids with.</p></td>
</tr>
</table>
<h2 id="detail_method">Method Detail</h2>
<div class="location">/Doctrine/Common/Cache/AbstractCache.php at line 65</div>
<h3 id="contains()">contains</h3>
<code class="signature">public void <strong>contains</strong>(mixed id)</code>
<div class="details">
<p></p></div>
<hr>
<div class="location">/Doctrine/Common/Cache/AbstractCache.php at line 82</div>
<h3 id="delete()">delete</h3>
<code class="signature">public void <strong>delete</strong>(mixed id)</code>
<div class="details">
<p></p></div>
<hr>
<div class="location">/Doctrine/Common/Cache/AbstractCache.php at line 98</div>
<h3 id="deleteAll()">deleteAll</h3>
<code class="signature">public array <strong>deleteAll</strong>()</code>
<div class="details">
<p>Delete all cache entries.</p><dl>
<dt>Returns:</dt>
<dd>$deleted Array of the deleted cache ids</dd>
</dl>
</div>
<hr>
<div class="location">/Doctrine/Common/Cache/AbstractCache.php at line 132</div>
<h3 id="deleteByPrefix()">deleteByPrefix</h3>
<code class="signature">public array <strong>deleteByPrefix</strong>(string prefix)</code>
<div class="details">
<p>Delete cache entries where the id has the passed prefix</p><dl>
<dt>Returns:</dt>
<dd>$deleted Array of the deleted cache ids</dd>
</dl>
</div>
<hr>
<div class="location">/Doctrine/Common/Cache/AbstractCache.php at line 113</div>
<h3 id="deleteByRegex()">deleteByRegex</h3>
<code class="signature">public array <strong>deleteByRegex</strong>(string regex)</code>
<div class="details">
<p>Delete cache entries where the id matches a PHP regular expressions</p><dl>
<dt>Returns:</dt>
<dd>$deleted Array of the deleted cache ids</dd>
</dl>
</div>
<hr>
<div class="location">/Doctrine/Common/Cache/AbstractCache.php at line 151</div>
<h3 id="deleteBySuffix()">deleteBySuffix</h3>
<code class="signature">public array <strong>deleteBySuffix</strong>(string suffix)</code>
<div class="details">
<p>Delete cache entries where the id has the passed suffix</p><dl>
<dt>Returns:</dt>
<dd>$deleted Array of the deleted cache ids</dd>
</dl>
</div>
<hr>
<div class="location">/Doctrine/Common/Cache/AbstractCache.php at line 57</div>
<h3 id="fetch()">fetch</h3>
<code class="signature">public void <strong>fetch</strong>(mixed id)</code>
<div class="details">
<p></p></div>
<hr>
<div class="location">/Doctrine/Common/Cache/AbstractCache.php at line 218</div>
<h3 id="getIds()">getIds</h3>
<code class="signature">public abstract array <strong>getIds</strong>()</code>
<div class="details">
<p>Get an array of all the cache ids stored</p><dl>
<dt>Returns:</dt>
<dd>$ids</dd>
</dl>
</div>
<hr>
<div class="location">/Doctrine/Common/Cache/AbstractCache.php at line 73</div>
<h3 id="save()">save</h3>
<code class="signature">public void <strong>save</strong>(mixed id, mixed data, mixed lifeTime)</code>
<div class="details">
<p></p></div>
<hr>
<div class="location">/Doctrine/Common/Cache/AbstractCache.php at line 49</div>
<h3 id="setNamespace()">setNamespace</h3>
<code class="signature">public void <strong>setNamespace</strong>(string namespace)</code>
<div class="details">
<p>Set the namespace to prefix all cache ids with.</p></div>
<hr>
<div class="header">
<h1>Doctrine</h1>
<ul>
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="../../../doctrine/common/cache/package-summary.html">Namespace</a></li>
<li class="active">Class</li>
<li><a href="../../../doctrine/common/cache/package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-all.html">Index</a></li>
</ul>
</div>
<div class="small_links">
<a href="../../../index.html" target="_top">Frames</a>
<a href="../../../doctrine/common/cache/abstractcache.html" target="_top">No frames</a>
</div>
<div class="small_links">
Summary: <a href="#summary_field">Field</a> | <a href="#summary_method">Method</a> | <a href="#summary_constr">Constr</a>
Detail: <a href="#detail_field">Field</a> | <a href="#detail_method">Method</a> | <a href="#summary_constr">Constr</a>
</div>
<hr>
<p id="footer">This document was generated by <a href="http://peej.github.com/phpdoctor/">PHPDoctor: The PHP Documentation Creator</a></p>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta name="generator" content="PHPDoctor 2RC4 (http://phpdoctor.sourceforge.net/)">
<meta name="when" content="Wed, 14 Apr 2010 15:12:03 +0000">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css">
<link rel="start" href="../../../overview-summary.html">
<title>Doctrine\Common\Cache (Doctrine)</title>
</head>
<body id="frame">
<h1><a href="package-summary.html" target="main">Doctrine\Common\Cache</a></h1>
<h2>Classes</h2>
<ul>
<li><a href="../../../doctrine/common/cache/abstractcache.html" target="main">AbstractCache</a></li>
<li><a href="../../../doctrine/common/cache/apccache.html" target="main">ApcCache</a></li>
<li><a href="../../../doctrine/common/cache/arraycache.html" target="main">ArrayCache</a></li>
<li><a href="../../../doctrine/common/cache/memcachecache.html" target="main">MemcacheCache</a></li>
<li><a href="../../../doctrine/common/cache/xcachecache.html" target="main">XcacheCache</a></li>
</ul>
<h2>Interfaces</h2>
<ul>
<li><a href="../../../doctrine/common/cache/cache.html" target="main">Cache</a></li>
</ul>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta name="generator" content="PHPDoctor 2RC4 (http://phpdoctor.sourceforge.net/)">
<meta name="when" content="Wed, 14 Apr 2010 15:12:03 +0000">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css">
<link rel="start" href="../../../overview-summary.html">
<title>Doctrine\Common\Collections (Doctrine)</title>
</head>
<body id="frame">
<h1><a href="package-summary.html" target="main">Doctrine\Common\Collections</a></h1>
<h2>Classes</h2>
<ul>
<li><a href="../../../doctrine/common/collections/arraycollection.html" target="main">ArrayCollection</a></li>
</ul>
<h2>Interfaces</h2>
<ul>
<li><a href="../../../doctrine/common/collections/collection.html" target="main">Collection</a></li>
</ul>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment