Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
a7699974
Commit
a7699974
authored
Jul 27, 2008
by
romanb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
d17a68a4
Changes
38
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
38 changed files
with
554 additions
and
877 deletions
+554
-877
Access.php
lib/Doctrine/Access.php
+3
-1
ManyToMany.php
lib/Doctrine/Association/ManyToMany.php
+4
-4
OneToMany.php
lib/Doctrine/Association/OneToMany.php
+9
-9
OneToOne.php
lib/Doctrine/Association/OneToOne.php
+7
-4
ClassMetadata.php
lib/Doctrine/ClassMetadata.php
+62
-39
Compiler.php
lib/Doctrine/Compiler.php
+2
-1
Configuration.php
lib/Doctrine/Configuration.php
+3
-3
Connection.php
lib/Doctrine/Connection.php
+222
-135
Mssql.php
lib/Doctrine/Connection/Mssql.php
+0
-1
UnitOfWork.php
lib/Doctrine/Connection/UnitOfWork.php
+9
-2
DataDict.php
lib/Doctrine/DataDict.php
+1
-0
Firebird.php
lib/Doctrine/DataDict/Firebird.php
+2
-2
Informix.php
lib/Doctrine/DataDict/Informix.php
+1
-1
Mysql.php
lib/Doctrine/DataDict/Mysql.php
+1
-1
Oracle.php
lib/Doctrine/DataDict/Oracle.php
+1
-1
Entity.php
lib/Doctrine/Entity.php
+29
-276
EntityManager.php
lib/Doctrine/EntityManager.php
+25
-20
Abstract.php
lib/Doctrine/EntityPersister/Abstract.php
+106
-112
Export.php
lib/Doctrine/Export.php
+1
-0
Oracle.php
lib/Doctrine/Export/Oracle.php
+1
-1
Expression.php
lib/Doctrine/Expression.php
+2
-1
Driver.php
lib/Doctrine/Expression/Driver.php
+1
-1
Formatter.php
lib/Doctrine/Formatter.php
+2
-211
Abstract.php
lib/Doctrine/Hydrator/Abstract.php
+2
-9
ArrayDriver.php
lib/Doctrine/Hydrator/ArrayDriver.php
+2
-12
RecordDriver.php
lib/Doctrine/Hydrator/RecordDriver.php
+2
-4
HydratorNew.php
lib/Doctrine/HydratorNew.php
+6
-15
CommitOrderCalculator.php
lib/Doctrine/Internal/CommitOrderCalculator.php
+19
-0
CommitOrderNode.php
lib/Doctrine/Internal/CommitOrderNode.php
+20
-3
Sequence.php
lib/Doctrine/Sequence.php
+0
-1
Mysql.php
lib/Doctrine/Sequence/Mysql.php
+2
-0
Mssql.php
lib/Doctrine/Transaction/Mssql.php
+1
-1
UnitOfWorkTest.php
tests/Orm/UnitOfWorkTest.php
+1
-1
Doctrine_ConnectionMock.php
tests/lib/mocks/Doctrine_ConnectionMock.php
+1
-1
CmsArticle.php
tests/models/cms/CmsArticle.php
+1
-1
CmsUser.php
tests/models/cms/CmsUser.php
+1
-1
ForumEntry.php
tests/models/forum/ForumEntry.php
+1
-1
ForumUser.php
tests/models/forum/ForumUser.php
+1
-1
No files found.
lib/Doctrine/Access.php
View file @
a7699974
...
...
@@ -33,7 +33,9 @@
* @link www.phpdoctrine.org
* @since 1.0
* @version $Revision$
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @todo Consider making Collection & Entity implement ArrayAccess directly.
* This base class is not really a huge benefit.
*/
abstract
class
Doctrine_Access
implements
ArrayAccess
{
...
...
lib/Doctrine/Association/ManyToMany.php
View file @
a7699974
...
...
@@ -33,16 +33,16 @@ class Doctrine_Association_ManyToMany extends Doctrine_Association
private
$_relationTableName
;
/** The field in the source table that corresponds to the key in the relation table */
protected
$_sourceKey
Field
s
;
protected
$_sourceKey
Column
s
;
/** The field in the target table that corresponds to the key in the relation table */
protected
$_targetKey
Field
s
;
protected
$_targetKey
Column
s
;
/** The field in the intermediate table that corresponds to the key in the source table */
protected
$_sourceRelationKey
Field
s
;
protected
$_sourceRelationKey
Column
s
;
/** The field in the intermediate table that corresponds to the key in the target table */
protected
$_targetRelationKey
Field
s
;
protected
$_targetRelationKey
Column
s
;
/**
...
...
lib/Doctrine/Association/OneToMany.php
View file @
a7699974
...
...
@@ -4,24 +4,24 @@
class
Doctrine_Association_OneToMany
extends
Doctrine_Association
{
/** The target foreign key
fields that reference the sourceKeyField
s. */
protected
$_targetForeignKey
Field
s
;
/** The target foreign key
columns that reference the sourceKeyColumn
s. */
protected
$_targetForeignKey
Column
s
;
/** The (typically primary) source key
fields that are referenced by the targetForeignKeyField
s. */
protected
$_sourceKey
Field
s
;
/** The (typically primary) source key
columns that are referenced by the targetForeignKeyColumn
s. */
protected
$_sourceKey
Column
s
;
/** This maps the target foreign key
fields to the corresponding (primary) source key field
s. */
/** This maps the target foreign key
columns to the corresponding (primary) source key column
s. */
protected
$_targetForeignKeysToSourceKeys
;
/** This maps the (primary) source key
fields to the corresponding target foreign key field
s. */
/** This maps the (primary) source key
columns to the corresponding target foreign key column
s. */
protected
$_sourceKeysToTargetForeignKeys
;
/** Whether to delete orphaned elements (removed from the collection) */
protected
$_
isCascadeDeleteOrphan
=
false
;
protected
$_
deleteOrphans
=
false
;
public
function
isCascadeDeleteOrphan
()
public
function
shouldDeleteOrphans
()
{
return
$this
->
_
isCascadeDeleteOrphan
;
return
$this
->
_
deleteOrphans
;
}
}
...
...
lib/Doctrine/Association/OneToOne.php
View file @
a7699974
...
...
@@ -34,19 +34,22 @@
class
Doctrine_Association_OneToOne
extends
Doctrine_Association
{
/**
* Maps the source foreign/primary key
fields to the target primary/foreign key field
s.
* Maps the source foreign/primary key
columns to the target primary/foreign key column
s.
* i.e. source.id (pk) => target.user_id (fk).
* Reverse mapping of _targetToSourceKey
Field
s.
* Reverse mapping of _targetToSourceKey
Column
s.
*/
protected
$_sourceToTargetKeyColumns
=
array
();
/**
* Maps the target primary/foreign key
fields to the source foreign/primary key field
s.
* Maps the target primary/foreign key
columns to the source foreign/primary key column
s.
* i.e. target.user_id (fk) => source.id (pk).
* Reverse mapping of _sourceToTargetKey
Field
s.
* Reverse mapping of _sourceToTargetKey
Column
s.
*/
protected
$_targetToSourceKeyColumns
=
array
();
/** Whether to delete orphaned elements (when nulled out, i.e. $foo->other = null) */
protected
$_deleteOrphans
=
false
;
/**
* Constructor.
* Creates a new OneToOneMapping.
...
...
lib/Doctrine/ClassMetadata.php
View file @
a7699974
...
...
@@ -40,18 +40,6 @@ class Doctrine_ClassMetadata implements Doctrine_Configurable, Serializable
const
INHERITANCE_TYPE_SINGLE_TABLE
=
'singleTable'
;
const
INHERITANCE_TYPE_TABLE_PER_CLASS
=
'tablePerClass'
;
/**
* Inheritance types enumeration.
*
* @var array
*/
protected
static
$_inheritanceTypes
=
array
(
self
::
INHERITANCE_TYPE_NONE
,
self
::
INHERITANCE_TYPE_JOINED
,
self
::
INHERITANCE_TYPE_SINGLE_TABLE
,
self
::
INHERITANCE_TYPE_TABLE_PER_CLASS
);
/* The Id generator types. TODO: belongs more in a DBAL class */
const
GENERATOR_TYPE_AUTO
=
'auto'
;
const
GENERATOR_TYPE_SEQUENCE
=
'sequence'
;
...
...
@@ -59,18 +47,14 @@ class Doctrine_ClassMetadata implements Doctrine_Configurable, Serializable
const
GENERATOR_TYPE_IDENTITY
=
'identity'
;
const
GENERATOR_TYPE_NONE
=
'none'
;
/**
* Id Generator types enumeration.
*
* @var array
*/
protected
static
$_generatorTypes
=
array
(
self
::
GENERATOR_TYPE_AUTO
,
self
::
GENERATOR_TYPE_SEQUENCE
,
self
::
GENERATOR_TYPE_TABLE
,
self
::
GENERATOR_TYPE_IDENTITY
,
self
::
GENERATOR_TYPE_NONE
);
/* The Entity types */
// A regular entity is assumed to have persistent state that Doctrine should manage.
const
ENTITY_TYPE_REGULAR
=
'regular'
;
// A transient entity is ignored by Doctrine.
const
ENTITY_TYPE_TRANSIENT
=
'transient'
;
// A mapped superclass entity is itself not persisted by Doctrine but it's
// field & association mappings are inherited by subclasses.
const
ENTITY_TYPE_MAPPED_SUPERCLASS
=
'mappedSuperclass'
;
/**
* The name of the entity class.
...
...
@@ -171,14 +155,11 @@ class Doctrine_ClassMetadata implements Doctrine_Configurable, Serializable
* 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>generatorType</b> (string, optional, requires: id)
* The generation type used for the field. Optional. Can only be applied on
* fields that are marked with the 'id' attribute. The possible values are:
* auto, identity, sequence, table.
*
* - <b>generator</b> (array, optional, requires: generationType=table|sequence)
* The generator options for a table or sequence generator. Can only be applied
* on fields that have a generationType of 'table' or 'sequence'.
* - <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 TRUE.
...
...
@@ -755,15 +736,16 @@ class Doctrine_ClassMetadata implements Doctrine_Configurable, Serializable
if
(
!
in_array
(
$mapping
[
'fieldName'
],
$this
->
_identifier
))
{
$this
->
_identifier
[]
=
$mapping
[
'fieldName'
];
}
if
(
isset
(
$mapping
[
'generatorType'
]))
{
if
(
!
in_array
(
$mapping
[
'generatorType'
],
self
::
$_generatorTypes
))
{
if
(
isset
(
$mapping
[
'idGenerator'
]))
{
if
(
!
$this
->
_isIdGeneratorType
(
$mapping
[
'idGenerator'
]))
{
//TODO: check if the idGenerator specifies an existing generator by name
throw
Doctrine_MappingException
::
invalidGeneratorType
(
$mapping
[
'generatorType'
]);
}
else
if
(
count
(
$this
->
_identifier
)
>
1
)
{
throw
Doctrine_MappingException
::
generatorNotAllowedWithCompositeId
();
}
$this
->
_generatorType
=
$mapping
[
'
generatorType
'
];
$this
->
_generatorType
=
$mapping
[
'
idGenerator
'
];
}
// TODO: validate/complete '
generator' mapping
// TODO: validate/complete '
tableGenerator' and 'sequenceGenerator' mappings
// Check for composite key
if
(
!
$this
->
_isIdentifierComposite
&&
count
(
$this
->
_identifier
)
>
1
)
{
...
...
@@ -1170,7 +1152,7 @@ class Doctrine_ClassMetadata implements Doctrine_Configurable, Serializable
.
" must share the same inheritance mapping type and this type must be set"
.
" in the root class of the hierarchy."
);
}
if
(
!
in_array
(
$type
,
self
::
$_inheritanceTypes
))
{
if
(
!
$this
->
_isInheritanceType
(
$type
))
{
throw
Doctrine_MappingException
::
invalidInheritanceType
(
$type
);
}
...
...
@@ -1410,8 +1392,7 @@ class Doctrine_ClassMetadata implements Doctrine_Configurable, Serializable
*/
public
function
setTableName
(
$tableName
)
{
$this
->
setTableOption
(
'tableName'
,
$this
->
_em
->
getConnection
()
->
getFormatter
()
->
getTableName
(
$tableName
));
$this
->
setTableOption
(
'tableName'
,
$tableName
);
}
/**
...
...
@@ -1440,6 +1421,48 @@ class Doctrine_ClassMetadata implements Doctrine_Configurable, Serializable
{
return
true
;
}
/**
* Checks whether the given name identifies an entity type.
*
* @param string $type
* @return boolean
*/
private
function
_isEntityType
(
$type
)
{
return
$type
==
self
::
ENTITY_TYPE_REGULAR
||
$type
==
self
::
ENTITY_TYPE_MAPPED_SUPERCLASS
||
$type
==
self
::
ENTITY_TYPE_TRANSIENT
;
}
/**
* Checks whether the given name identifies an inheritance type.
*
* @param string $type
* @return boolean
*/
private
function
_isInheritanceType
(
$type
)
{
return
$type
==
self
::
INHERITANCE_TYPE_NONE
||
$type
==
self
::
INHERITANCE_TYPE_SINGLE_TABLE
||
$type
==
self
::
INHERITANCE_TYPE_JOINED
||
$type
==
self
::
INHERITANCE_TYPE_TABLE_PER_CLASS
;
}
/**
* Checks whether the given name 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
;
}
/**
* Adds a one-to-one association mapping.
...
...
lib/Doctrine/Compiler.php
View file @
a7699974
...
...
@@ -31,7 +31,8 @@
* @license http://www.opensource.org/licenses/lgpllicense.php LGPL
* @link www.phpdoctrine.
* @since 1.0
* @version $Revision$
* @version $Revision$
* @todo Remove or put in a separate package and look for a maintainer.
*/
class
Doctrine_Compiler
{
...
...
lib/Doctrine/Configuration.php
View file @
a7699974
...
...
@@ -40,7 +40,7 @@ class Doctrine_Configuration
* @var array
*/
private
$_attributes
=
array
(
'quoteIdentifier'
=>
false
,
'quoteIdentifier
s
'
=>
false
,
'indexNameFormat'
=>
'%s_idx'
,
'sequenceNameFormat'
=>
'%s_seq'
,
'tableNameFormat'
=>
'%s'
,
...
...
@@ -85,7 +85,7 @@ class Doctrine_Configuration
*/
public
function
get
(
$name
)
{
if
(
!
$this
->
has
Attribute
(
$name
))
{
if
(
!
$this
->
has
(
$name
))
{
throw
Doctrine_Configuration_Exception
::
unknownAttribute
(
$name
);
}
if
(
$this
->
_attributes
[
$name
]
===
$this
->
_nullObject
)
{
...
...
@@ -102,7 +102,7 @@ class Doctrine_Configuration
*/
public
function
set
(
$name
,
$value
)
{
if
(
!
$this
->
has
Attribute
(
$name
))
{
if
(
!
$this
->
has
(
$name
))
{
throw
Doctrine_Configuration_Exception
::
unknownAttribute
(
$name
);
}
// TODO: do some value checking depending on the attribute
...
...
lib/Doctrine/Connection.php
View file @
a7699974
This diff is collapsed.
Click to expand it.
lib/Doctrine/Connection/Mssql.php
View file @
a7699974
...
...
@@ -69,7 +69,6 @@ class Doctrine_Connection_Mssql extends Doctrine_Connection
}
/**
* quoteIdentifier
* Quote a string so it can be safely used as a table / column name
*
* Quoting style depends on which database driver is being used.
...
...
lib/Doctrine/Connection/UnitOfWork.php
View file @
a7699974
...
...
@@ -90,7 +90,6 @@ class Doctrine_Connection_UnitOfWork
* entities need to be written to the database.
*
* @var Doctrine::ORM::Internal::CommitOrderCalculator
* @todo Implementation. Replace buildFlushTree().
*/
protected
$_commitOrderCalculator
;
...
...
@@ -563,6 +562,13 @@ class Doctrine_Connection_UnitOfWork
// In both cases we must commit the inserts instantly.
//TODO: Isnt it enough to only execute the inserts instead of full flush?
$this
->
commit
();
/* The following may be better:
$commitOrder = $this->_getCommitOrder($insertNow);
foreach ($commitOrder as $class) {
$this->_executeInserts($class);
}
//... remove them from _newEntities, or dont store them there in the first place
*/
}
}
...
...
@@ -593,11 +599,12 @@ class Doctrine_Connection_UnitOfWork
$this
->
_newEntities
[
$entity
->
getOid
()]
=
$entity
;
}
else
if
(
!
$class
->
usesIdGenerator
())
{
$insertNow
[
$entity
->
getOid
()]
=
$entity
;
$this
->
_newEntities
[
$entity
->
getOid
()]
=
$entity
;
//...
}
else
if
(
$class
->
isIdGeneratorSequence
())
{
// Get the next sequence number
//TODO: sequence name?
$id
=
$this
->
_em
->
getConnection
()
->
getSequenceM
odule
()
->
nextId
(
"foo"
);
$id
=
$this
->
_em
->
getConnection
()
->
getSequenceM
anager
()
->
nextId
(
"foo"
);
$entity
->
set
(
$class
->
getSingleIdentifierFieldName
(),
$id
);
$this
->
registerNew
(
$entity
);
}
else
{
...
...
lib/Doctrine/DataDict.php
View file @
a7699974
...
...
@@ -32,6 +32,7 @@
* @version $Revision$
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @author Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
* @todo Merge all the DataDict classes into the appropriate DBAL DatabasePlatform classes.
*/
class
Doctrine_DataDict
extends
Doctrine_Connection_Module
{
...
...
lib/Doctrine/DataDict/Firebird.php
View file @
a7699974
...
...
@@ -18,7 +18,7 @@
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
Doctrine
::
autoload
(
'Doctrine_DataDict'
);
/**
* @package Doctrine
* @subpackage DataDict
...
...
@@ -108,7 +108,7 @@ class Doctrine_DataDict_Firebird extends Doctrine_DataDict
*/
public
function
getPortableDeclaration
(
$field
)
{
$length
=
(
isset
(
$field
[
'length'
])
&&
$field
[
'length'
]
>
0
)
?
$field
[
'length'
]
:
null
;
$length
=
(
isset
(
$field
[
'length'
])
&&
$field
[
'length'
]
>
0
)
?
$field
[
'length'
]
:
null
;
$type
=
array
();
$unsigned
=
$fixed
=
null
;
...
...
lib/Doctrine/DataDict/Informix.php
View file @
a7699974
...
...
@@ -18,7 +18,7 @@
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
Doctrine
::
autoload
(
'Doctrine_DataDict'
);
/**
* @package Doctrine
* @subpackage DataDict
...
...
lib/Doctrine/DataDict/Mysql.php
View file @
a7699974
...
...
@@ -18,7 +18,7 @@
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
Doctrine
::
autoload
(
'Doctrine_DataDict'
);
/**
* @package Doctrine
* @subpackage DataDict
...
...
lib/Doctrine/DataDict/Oracle.php
View file @
a7699974
...
...
@@ -18,7 +18,7 @@
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
Doctrine
::
autoload
(
'Doctrine_DataDict'
);
/**
* @package Doctrine
* @subpackage DataDict
...
...
lib/Doctrine/Entity.php
View file @
a7699974
This diff is collapsed.
Click to expand it.
lib/Doctrine/EntityManager.php
View file @
a7699974
...
...
@@ -403,6 +403,27 @@ class Doctrine_EntityManager
$this
->
_unitOfWork
->
delete
(
$entity
);
}
/**
* Refreshes the persistent state of the entity from the database.
*
* @param Doctrine_Entity $entity
*/
public
function
refresh
(
Doctrine_Entity
$entity
)
{
//...
}
/**
* Creates a copy of the given entity. Can create a shallow or a deep copy.
*
* @param Doctrine::ORM::Entity $entity The entity to copy.
* @return Doctrine::ORM::Entity The new entity.
*/
public
function
copy
(
Doctrine_Entity
$entity
,
$deep
=
false
)
{
//...
}
/**
* Gets the repository for an Entity.
*
...
...
@@ -466,12 +487,6 @@ class Doctrine_EntityManager
}
else
{
$entity
=
new
$className
;
}
/*if (count($data) < $classMetadata->getMappedColumnCount()) {
$entity->_state(Doctrine_Entity::STATE_PROXY);
} else {
$entity->_state(Doctrine_Entity::STATE_CLEAN);
}*/
return
$entity
;
}
...
...
@@ -523,20 +538,10 @@ class Doctrine_EntityManager
}
}
/**
* Gets the UnitOfWork used by the EntityManager.
*
* @return UnitOfWork
*/
/*public function getUnitOfWork()
{
return $this->_unitOfWork;
}*/
/**
* Gets the EventManager used by the EntityManager.
*
* @return EventManager
* @return
Doctrine::Common::
EventManager
*/
public
function
getEventManager
()
{
...
...
@@ -546,7 +551,7 @@ class Doctrine_EntityManager
/**
* Sets the EventManager used by the EntityManager.
*
* @param Doctrine
_
EventManager $eventManager
* @param Doctrine
::Common::
EventManager $eventManager
*/
public
function
setEventManager
(
Doctrine_EventManager
$eventManager
)
{
...
...
@@ -556,7 +561,7 @@ class Doctrine_EntityManager
/**
* Sets the Configuration used by the EntityManager.
*
* @param Doctrine
_
Configuration $config
* @param Doctrine
::Common::
Configuration $config
*/
public
function
setConfiguration
(
Doctrine_Configuration
$config
)
{
...
...
@@ -566,7 +571,7 @@ class Doctrine_EntityManager
/**
* Gets the Configuration used by the EntityManager.
*
* @return Configuration
* @return
Doctrine::Common::
Configuration
*/
public
function
getConfiguration
()
{
...
...
lib/Doctrine/EntityPersister/Abstract.php
View file @
a7699974
...
...
@@ -19,20 +19,22 @@
* <http://www.phpdoctrine.org>.
*/
#namespace Doctrine::ORM::Persisters;
/**
*
*
Base class for all EntityPersisters.
*
* @author Roman Borschel <roman@code-factory.org>
* @package Doctrine
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @version $Revision: 3406 $
* @link www.phpdoctrine.org
* @since 2.0
* @todo Rename to AbstractEntityPersister
*/
abstract
class
Doctrine_EntityPersister_Abstract
{
/**
* The names of all the fields that are available on entities
created by this mapper
.
* The names of all the fields that are available on entities.
*/
protected
$_fieldNames
=
array
();
...
...
@@ -44,9 +46,11 @@ abstract class Doctrine_EntityPersister_Abstract
protected
$_classMetadata
;
/**
* The name of the domain class this mapper is used for.
* The name of the Entity the persister is used for.
*
* @var string
*/
protected
$_
domainClass
Name
;
protected
$_
entity
Name
;
/**
* The Doctrine_Connection object that the database connection of this mapper.
...
...
@@ -58,7 +62,7 @@ abstract class Doctrine_EntityPersister_Abstract
/**
* The EntityManager.
*
* @var
unknown_type
* @var
Doctrine::ORM::EntityManager
*/
protected
$_em
;
...
...
@@ -66,32 +70,102 @@ abstract class Doctrine_EntityPersister_Abstract
* Null object.
*/
private
$_nullObject
;
/**
* Enter description here...
*
* @var unknown_type
* @todo To EntityManager.
*/
private
$_dataTemplate
=
array
();
/**
* Constructs a new mapper.
*
* @param string $name The name of the domain class this mapper is used for.
* @param Doctrine_Table $table The table object used for the mapping procedure.
* @throws Doctrine_Connection_Exception if there are no opened connections
* Constructs a new persister.
*/
public
function
__construct
(
Doctrine_EntityManager
$em
,
Doctrine_ClassMetadata
$classMetadata
)
{
$this
->
_em
=
$em
;
$this
->
_
domainClass
Name
=
$classMetadata
->
getClassName
();
$this
->
_conn
=
$
classMetadata
->
getConnection
();
$this
->
_
entity
Name
=
$classMetadata
->
getClassName
();
$this
->
_conn
=
$
em
->
getConnection
();
$this
->
_classMetadata
=
$classMetadata
;
$this
->
_nullObject
=
Doctrine_Null
::
$INSTANCE
;
}
public
function
insert
(
Doctrine_Entity
$entity
)
{
//...
}
public
function
update
(
Doctrine_Entity
$entity
)
{
//...
}
public
function
delete
(
Doctrine_Entity
$entity
)
{
}
/**
* Inserts a row into a table.
*
* @todo This method could be used to allow mapping to secondary table(s).
* @see http://www.oracle.com/technology/products/ias/toplink/jpa/resources/toplink-jpa-annotations.html#SecondaryTable
*/
protected
function
_insertRow
(
$tableName
,
array
$data
)
{
$this
->
_conn
->
insert
(
$tableName
,
$data
);
}
/**
* Deletes rows of a table.
*
* @todo This method could be used to allow mapping to secondary table(s).
* @see http://www.oracle.com/technology/products/ias/toplink/jpa/resources/toplink-jpa-annotations.html#SecondaryTable
*/
protected
function
_deleteRow
(
$tableName
,
array
$identifierToMatch
)
{
$this
->
_conn
->
delete
(
$tableName
,
$identifierToMatch
);
}
/**
* Deletes rows of a table.
*
* @todo This method could be used to allow mapping to secondary table(s).
* @see http://www.oracle.com/technology/products/ias/toplink/jpa/resources/toplink-jpa-annotations.html#SecondaryTable
*/
protected
function
_updateRow
(
$tableName
,
array
$data
,
array
$identifierToMatch
)
{
$this
->
_conn
->
update
(
$tableName
,
$data
,
$identifierToMatch
);
}
public
function
getClassMetadata
()
{
return
$this
->
_classMetadata
;
}
public
function
getFieldNames
()
{
if
(
$this
->
_fieldNames
)
{
return
$this
->
_fieldNames
;
}
$this
->
_fieldNames
=
$this
->
_classMetadata
->
getFieldNames
();
return
$this
->
_fieldNames
;
}
public
function
getOwningClass
(
$fieldName
)
{
return
$this
->
_classMetadata
;
}
/**
* Callback that is invoked during the SQL construction process.
*/
public
function
getCustomJoins
()
{
return
array
();
}
/**
* Callback that is invoked during the SQL construction process.
*/
public
function
getCustomFields
()
{
return
array
();
}
/**
* Assumes that the keys of the given field array are field names and converts
* them to column names.
...
...
@@ -108,6 +182,14 @@ abstract class Doctrine_EntityPersister_Abstract
return
$converted
;
}
#############################################################
# The following is old code that needs to be removed/ported
/**
* deletes all related composites
* this method is always called internally when a record is deleted
...
...
@@ -129,19 +211,6 @@ abstract class Doctrine_EntityPersister_Abstract
}
}
/**
* sets the connection for this class
*
* @params Doctrine_Connection a connection object
* @return Doctrine_Table this object
* @todo refactor
*/
/*public function setConnection(Doctrine_Connection $conn)
{
$this->_conn = $conn;
return $this;
}*/
/**
* Returns the connection the mapper is currently using.
*
...
...
@@ -482,7 +551,7 @@ abstract class Doctrine_EntityPersister_Abstract
* @return boolean true on success, false on failure
* @throws Doctrine_Mapper_Exception
*/
public
function
delete
(
Doctrine_Entity
$record
,
Doctrine_Connection
$conn
=
null
)
public
function
delete
_old
(
Doctrine_Entity
$record
)
{
if
(
!
$record
->
exists
())
{
return
false
;
...
...
@@ -513,80 +582,5 @@ abstract class Doctrine_EntityPersister_Abstract
return
true
;
}
abstract
protected
function
_doDelete
(
Doctrine_Entity
$entity
);
/**
* Inserts a row into a table.
*
* @todo This method could be used to allow mapping to secondary table(s).
* @see http://www.oracle.com/technology/products/ias/toplink/jpa/resources/toplink-jpa-annotations.html#SecondaryTable
*/
protected
function
_insertRow
(
$tableName
,
array
$data
)
{
$this
->
_conn
->
insert
(
$tableName
,
$data
);
}
/**
* Deletes rows of a table.
*
* @todo This method could be used to allow mapping to secondary table(s).
* @see http://www.oracle.com/technology/products/ias/toplink/jpa/resources/toplink-jpa-annotations.html#SecondaryTable
*/
protected
function
_deleteRow
(
$tableName
,
array
$identifierToMatch
)
{
$this
->
_conn
->
delete
(
$tableName
,
$identifierToMatch
);
}
/**
* Deletes rows of a table.
*
* @todo This method could be used to allow mapping to secondary table(s).
* @see http://www.oracle.com/technology/products/ias/toplink/jpa/resources/toplink-jpa-annotations.html#SecondaryTable
*/
protected
function
_updateRow
(
$tableName
,
array
$data
,
array
$identifierToMatch
)
{
$this
->
_conn
->
update
(
$tableName
,
$data
,
$identifierToMatch
);
}
public
function
getClassMetadata
()
{
return
$this
->
_classMetadata
;
}
/*public function getFieldName($columnName)
{
return $this->_classMetadata->getFieldName($columnName);
}*/
public
function
getFieldNames
()
{
if
(
$this
->
_fieldNames
)
{
return
$this
->
_fieldNames
;
}
$this
->
_fieldNames
=
$this
->
_classMetadata
->
getFieldNames
();
return
$this
->
_fieldNames
;
}
public
function
getOwningClass
(
$fieldName
)
{
return
$this
->
_classMetadata
;
}
/* Hooks used during SQL query construction to manipulate the query. */
/**
* Callback that is invoked during the SQL construction process.
*/
public
function
getCustomJoins
()
{
return
array
();
}
/**
* Callback that is invoked during the SQL construction process.
*/
public
function
getCustomFields
()
{
return
array
();
}
}
lib/Doctrine/Export.php
View file @
a7699974
...
...
@@ -32,6 +32,7 @@
* @link www.phpdoctrine.org
* @since 1.0
* @version $Revision$
* @todo Rename to ExportManager. Subclasses: MySqlExportManager, PgSqlExportManager etc.
*/
class
Doctrine_Export
extends
Doctrine_Connection_Module
{
...
...
lib/Doctrine/Export/Oracle.php
View file @
a7699974
...
...
@@ -18,7 +18,7 @@
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
Doctrine
::
autoload
(
'Doctrine_Export'
);
/**
* Doctrine_Export_Oracle
*
...
...
lib/Doctrine/Expression.php
View file @
a7699974
...
...
@@ -30,7 +30,8 @@
* @link www.phpdoctrine.org
* @since 1.0
* @version $Revision$
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @todo Merge all Expression classes into the appropriate DBAL DatabasePlatform classes.
*/
class
Doctrine_Expression
{
...
...
lib/Doctrine/Expression/Driver.php
View file @
a7699974
...
...
@@ -18,7 +18,7 @@
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
Doctrine
::
autoload
(
'Doctrine_Connection_Module'
);
/**
* Doctrine_Expression_Driver
*
...
...
lib/Doctrine/Formatter.php
View file @
a7699974
...
...
@@ -30,219 +30,10 @@
* @link www.phpdoctrine.org
* @since 1.0
* @version $Revision$
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @todo Remove
*/
class
Doctrine_Formatter
extends
Doctrine_Connection_Module
{
/**
* Quotes pattern (% and _) characters in a string)
*
* EXPERIMENTAL
*
* WARNING: this function is experimental and may change signature at
* any time until labelled as non-experimental
*
* @param string the input string to quote
*
* @return string quoted string
*/
public
function
escapePattern
(
$text
)
{
return
$text
;
/*if ( ! $this->string_quoting['escape_pattern']) {
return $text;
}
$tmp = $this->conn->string_quoting;
$text = str_replace($tmp['escape_pattern'],
$tmp['escape_pattern'] .
$tmp['escape_pattern'], $text);
foreach ($this->wildcards as $wildcard) {
$text = str_replace($wildcard, $tmp['escape_pattern'] . $wildcard, $text);
}
return $text;*/
}
/**
* convertBooleans
* some drivers need the boolean values to be converted into integers
* when using DQL API
*
* This method takes care of that conversion
*
* @param array $item
* @return void
*/
public
function
convertBooleans
(
$item
)
{
if
(
is_array
(
$item
))
{
foreach
(
$item
as
$k
=>
$value
)
{
if
(
is_bool
(
$value
))
{
$item
[
$k
]
=
(
int
)
$value
;
}
}
}
else
{
if
(
is_bool
(
$item
))
{
$item
=
(
int
)
$item
;
}
}
return
$item
;
}
/**
* Quote a string so it can be safely used as a table or column name
*
* Delimiting style depends on which database driver is being used.
*
* NOTE: just because you CAN use delimited identifiers doesn't mean
* you SHOULD use them. In general, they end up causing way more
* problems than they solve.
*
* Portability is broken by using the following characters inside
* delimited identifiers:
* + backtick (<kbd>`</kbd>) -- due to MySQL
* + double quote (<kbd>"</kbd>) -- due to Oracle
* + brackets (<kbd>[</kbd> or <kbd>]</kbd>) -- due to Access
*
* Delimited identifiers are known to generally work correctly under
* the following drivers:
* + mssql
* + mysql
* + mysqli
* + oci8
* + pgsql
* + sqlite
*
* InterBase doesn't seem to be able to use delimited identifiers
* via PHP 4. They work fine under PHP 5.
*
* @param string $str identifier name to be quoted
* @param bool $checkOption check the 'quote_identifier' option
*
* @return string quoted identifier string
*/
public
function
quoteIdentifier
(
$str
,
$checkOption
=
true
)
{
if
(
$checkOption
&&
!
$this
->
conn
->
getAttribute
(
Doctrine
::
ATTR_QUOTE_IDENTIFIER
))
{
return
$str
;
}
$tmp
=
$this
->
conn
->
identifier_quoting
;
$str
=
str_replace
(
$tmp
[
'end'
],
$tmp
[
'escape'
]
.
$tmp
[
'end'
],
$str
);
return
$tmp
[
'start'
]
.
$str
.
$tmp
[
'end'
];
}
/**
* quote
* quotes given input parameter
*
* @param mixed $input parameter to be quoted
* @param string $type
* @return mixed
*/
public
function
quote
(
$input
,
$type
=
null
)
{
if
(
$type
==
null
)
{
$type
=
gettype
(
$input
);
}
switch
(
$type
)
{
case
'integer'
:
case
'enum'
:
case
'boolean'
:
case
'double'
:
case
'float'
:
case
'bool'
:
case
'decimal'
:
case
'int'
:
return
$input
;
case
'array'
:
case
'object'
:
$input
=
serialize
(
$input
);
case
'date'
:
case
'time'
:
case
'timestamp'
:
case
'string'
:
case
'char'
:
case
'varchar'
:
case
'text'
:
case
'gzip'
:
case
'blob'
:
case
'clob'
:
return
$this
->
conn
->
quote
(
$input
);
}
}
/**
* Removes any formatting in an sequence name using the 'seqname_format' option
*
* @param string $sqn string that containts name of a potential sequence
* @return string name of the sequence with possible formatting removed
*/
public
function
fixSequenceName
(
$sqn
)
{
$seqPattern
=
'/^'
.
preg_replace
(
'/%s/'
,
'([a-z0-9_]+)'
,
$this
->
conn
->
getAttribute
(
Doctrine
::
ATTR_SEQNAME_FORMAT
))
.
'$/i'
;
$seqName
=
preg_replace
(
$seqPattern
,
'\\1'
,
$sqn
);
if
(
$seqName
&&
!
strcasecmp
(
$sqn
,
$this
->
getSequenceName
(
$seqName
)))
{
return
$seqName
;
}
return
$sqn
;
}
/**
* Removes any formatting in an index name using the 'idxname_format' option
*
* @param string $idx string that containts name of anl index
* @return string name of the index with possible formatting removed
*/
public
function
fixIndexName
(
$idx
)
{
$indexPattern
=
'/^'
.
preg_replace
(
'/%s/'
,
'([a-z0-9_]+)'
,
$this
->
conn
->
getAttribute
(
Doctrine
::
ATTR_IDXNAME_FORMAT
))
.
'$/i'
;
$indexName
=
preg_replace
(
$indexPattern
,
'\\1'
,
$idx
);
if
(
$indexName
&&
!
strcasecmp
(
$idx
,
$this
->
getIndexName
(
$indexName
)))
{
return
$indexName
;
}
return
$idx
;
}
/**
* adds sequence name formatting to a sequence name
*
* @param string name of the sequence
* @return string formatted sequence name
*/
public
function
getSequenceName
(
$sqn
)
{
return
sprintf
(
$this
->
conn
->
getAttribute
(
Doctrine
::
ATTR_SEQNAME_FORMAT
),
preg_replace
(
'/[^a-z0-9_\$.]/i'
,
'_'
,
$sqn
));
}
/**
* adds index name formatting to a index name
*
* @param string name of the index
* @return string formatted index name
*/
public
function
getIndexName
(
$idx
)
{
return
sprintf
(
$this
->
conn
->
getAttribute
(
Doctrine
::
ATTR_IDXNAME_FORMAT
),
preg_replace
(
'/[^a-z0-9_\$]/i'
,
'_'
,
$idx
));
}
/**
* adds table name formatting to a table name
*
* @param string name of the table
* @return string formatted table name
*/
public
function
getTableName
(
$table
)
{
return
$table
;
/*
return sprintf($this->conn->getAttribute(Doctrine::ATTR_TBLNAME_FORMAT),
$table);*/
}
}
lib/Doctrine/Hydrator/Abstract.php
View file @
a7699974
...
...
@@ -20,15 +20,14 @@
*/
/**
*
Doctrine_Hydrator_Abstract
*
Base class for all hydrators (ok, we got only 1 currently).
*
* @package Doctrine
* @subpackage Hydrate
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.phpdoctrine.org
* @since 1.0
* @version $Revision: 3192 $
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @author Roman Borschel <roman@code-factory.org>
*/
abstract
class
Doctrine_Hydrator_Abstract
{
...
...
@@ -71,7 +70,6 @@ abstract class Doctrine_Hydrator_Abstract
$this
->
_nullObject
=
Doctrine_Null
::
$INSTANCE
;
}
/**
* setHydrationMode
*
...
...
@@ -85,7 +83,6 @@ abstract class Doctrine_Hydrator_Abstract
$this
->
_hydrationMode
=
$hydrationMode
;
}
/**
* setQueryComponents
*
...
...
@@ -98,7 +95,6 @@ abstract class Doctrine_Hydrator_Abstract
$this
->
_queryComponents
=
$queryComponents
;
}
/**
* getQueryComponents
*
...
...
@@ -111,7 +107,6 @@ abstract class Doctrine_Hydrator_Abstract
return
$this
->
_queryComponents
;
}
/**
* setTableAliasMap
*
...
...
@@ -124,7 +119,6 @@ abstract class Doctrine_Hydrator_Abstract
$this
->
_tableAliasMap
=
$tableAliasMap
;
}
/**
* getTableAliasMap
*
...
...
@@ -137,7 +131,6 @@ abstract class Doctrine_Hydrator_Abstract
return
$this
->
_tableAliasMap
;
}
/**
* hydrateResultSet
*
...
...
lib/Doctrine/Hydrator/ArrayDriver.php
View file @
a7699974
...
...
@@ -20,16 +20,14 @@
*/
/**
* Doctrine_Hydrator_ArrayDriver
* Defines an array fetching strategy.
* Defines an array hydration strategy.
*
* @package Doctrine
* @subpackage Hydrate
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.phpdoctrine.org
* @since 1.0
* @version $Revision$
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @author Roman Borschel <roman@code-factory.org>
*/
class
Doctrine_Hydrator_ArrayDriver
{
...
...
@@ -50,14 +48,6 @@ class Doctrine_Hydrator_ArrayDriver
return
$data
;
}
/**
*
*/
/*public function isIdentifiable(array $data, Doctrine_Table $table)
{
return ( ! empty($data));
}*/
/**
*
*/
...
...
lib/Doctrine/Hydrator/RecordDriver.php
View file @
a7699974
...
...
@@ -20,17 +20,15 @@
*/
/**
* Doctrine_Hydrator_RecordDriver
* Hydration strategy used for creating graphs of entity objects.
* Hydration strategy used for creating graphs of entities.
*
* @package Doctrine
* @subpackage Hydrate
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.phpdoctrine.org
* @since 1.0
* @version $Revision$
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @author Roman Borschel <roman@code-factory.org>
* @todo Rename to ObjectDriver
*/
class
Doctrine_Hydrator_RecordDriver
{
...
...
lib/Doctrine/HydratorNew.php
View file @
a7699974
...
...
@@ -170,10 +170,7 @@ class Doctrine_HydratorNew extends Doctrine_Hydrator_Abstract
$nonemptyComponents
=
array
();
$rowData
=
$this
->
_gatherRowData
(
$data
,
$cache
,
$id
,
$nonemptyComponents
);
// 2) Hydrate the data of the root entity from the current row
//$class = $this->_queryComponents[$rootAlias]['metadata'];
//$entityName = $class->getComponentName();
// 2) Hydrate the data of the root entity from the current row
// Check for an existing element
$index
=
false
;
if
(
$isSimpleQuery
||
!
isset
(
$identifierMap
[
$rootAlias
][
$id
[
$rootAlias
]]))
{
...
...
@@ -208,7 +205,7 @@ class Doctrine_HydratorNew extends Doctrine_Hydrator_Abstract
}
// 3) Now hydrate the rest of the data found in the current row, that
// belongs to other (related)
E
ntities.
// belongs to other (related)
e
ntities.
foreach
(
$rowData
as
$dqlAlias
=>
$data
)
{
$index
=
false
;
$map
=
$this
->
_queryComponents
[
$dqlAlias
];
...
...
@@ -295,7 +292,7 @@ class Doctrine_HydratorNew extends Doctrine_Hydrator_Abstract
/**
* Updates the result pointer for an Entity. The result pointers point to the
* last seen instance of each Entity. This is used for graph construction.
* last seen instance of each Entity
type
. This is used for graph construction.
*
* @param array $resultPointers The result pointers.
* @param array|Collection $coll The element.
...
...
@@ -540,13 +537,7 @@ class Doctrine_HydratorNew extends Doctrine_Hydrator_Abstract
case
'enum'
:
case
'boolean'
:
// don't do any conversions on primitive types
break
;
//case 'enum':
// return $class->enumValue($fieldName, $value);
//break;
//case 'boolean':
// return (boolean) $value;
//break;
break
;
case
'array'
:
case
'object'
:
if
(
is_string
(
$value
))
{
...
...
@@ -556,14 +547,14 @@ class Doctrine_HydratorNew extends Doctrine_Hydrator_Abstract
}
return
$value
;
}
break
;
break
;
case
'gzip'
:
$value
=
gzuncompress
(
$value
);
if
(
$value
===
false
)
{
throw
new
Doctrine_Hydrator_Exception
(
'Uncompressing of '
.
$fieldName
.
' failed.'
);
}
return
$value
;
break
;
break
;
}
}
return
$value
;
...
...
lib/Doctrine/Internal/CommitOrderCalculator.php
View file @
a7699974
<?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.phpdoctrine.org>.
*/
#namespace Doctrine::ORM::Internal;
...
...
lib/Doctrine/Internal/CommitOrderNode.php
View file @
a7699974
<?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.phpdoctrine.org>.
*/
#namespace Doctrine::ORM::Internal;
#use Doctrine::ORM::Mapping::ClassMetadata;
/**
* A CommitOrderNode is a temporary wrapper around ClassMetadata objects
* that is used to sort the order of commits.
...
...
@@ -123,7 +140,7 @@ class Doctrine_Internal_CommitOrderNode
}
/**
* Adds a directed dependency (an edge). "$this -before-> $other".
* Adds a directed dependency (an edge
on the graph
). "$this -before-> $other".
*
* @param Doctrine_Internal_CommitOrderNode $node
*/
...
...
lib/Doctrine/Sequence.php
View file @
a7699974
...
...
@@ -20,7 +20,6 @@
*/
/**
* Doctrine_Sequence
* The base class for sequence handling drivers.
*
* @package Doctrine
...
...
lib/Doctrine/Sequence/Mysql.php
View file @
a7699974
...
...
@@ -18,6 +18,8 @@
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
#namespace Doctrine::DBAL::Sequences;
/**
* Doctrine_Sequence_Mysql
...
...
lib/Doctrine/Transaction/Mssql.php
View file @
a7699974
...
...
@@ -18,7 +18,7 @@
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
Doctrine
::
autoload
(
'Doctrine_Transaction'
);
/**
*
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
...
...
tests/Orm/UnitOfWorkTest.php
View file @
a7699974
...
...
@@ -32,7 +32,7 @@ class Orm_UnitOfWorkTest extends Doctrine_OrmTestCase
$this
->
_user
->
username
=
'romanb'
;
$this
->
_connectionMock
=
new
Doctrine_ConnectionMock
(
array
());
$this
->
_sequenceMock
=
$this
->
_connectionMock
->
getSequenceM
odule
();
$this
->
_sequenceMock
=
$this
->
_connectionMock
->
getSequenceM
anager
();
$this
->
_emMock
=
new
Doctrine_EntityManagerMock
(
$this
->
_connectionMock
);
$this
->
_persisterMock
=
$this
->
_emMock
->
getEntityPersister
(
"ForumUser"
);
$this
->
_unitOfWork
=
$this
->
_emMock
->
getUnitOfWork
();
...
...
tests/lib/mocks/Doctrine_ConnectionMock.php
View file @
a7699974
...
...
@@ -7,7 +7,7 @@ class Doctrine_ConnectionMock extends Doctrine_Connection
protected
$_driverName
=
'Mysql'
;
private
$_sequenceModuleMock
;
public
function
getSequenceM
odule
()
public
function
getSequenceM
anager
()
{
if
(
!
$this
->
_sequenceModuleMock
)
{
$this
->
_sequenceModuleMock
=
new
Doctrine_SequenceMock
(
$this
);
...
...
tests/models/cms/CmsArticle.php
View file @
a7699974
...
...
@@ -18,7 +18,7 @@ class CmsArticle extends Doctrine_Entity
'type'
=>
'integer'
,
'length'
=>
4
,
'id'
=>
true
,
'
generatorType
'
=>
'auto'
'
idGenerator
'
=>
'auto'
));
$mapping
->
mapField
(
array
(
'fieldName'
=>
'topic'
,
...
...
tests/models/cms/CmsUser.php
View file @
a7699974
...
...
@@ -18,7 +18,7 @@ class CmsUser extends Doctrine_Entity
'type'
=>
'integer'
,
'length'
=>
4
,
'id'
=>
true
,
'
generatorType
'
=>
'auto'
'
idGenerator
'
=>
'auto'
));
$mapping
->
mapField
(
array
(
'fieldName'
=>
'status'
,
...
...
tests/models/forum/ForumEntry.php
View file @
a7699974
...
...
@@ -16,7 +16,7 @@ class ForumEntry extends Doctrine_Entity
'type'
=>
'integer'
,
'length'
=>
4
,
'id'
=>
true
,
'
generatorType
'
=>
'auto'
'
idGenerator
'
=>
'auto'
));
$mapping
->
mapField
(
array
(
'fieldName'
=>
'topic'
,
...
...
tests/models/forum/ForumUser.php
View file @
a7699974
...
...
@@ -34,7 +34,7 @@ class ForumUser extends Doctrine_Entity
'type'
=>
'integer'
,
'length'
=>
4
,
'id'
=>
true
,
'
generatorType
'
=>
'auto'
'
idGenerator
'
=>
'auto'
));
$mapping
->
mapField
(
array
(
'fieldName'
=>
'username'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment