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
18ec38ee
Commit
18ec38ee
authored
Sep 12, 2008
by
romanb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moved Entity
parent
9c11c36b
Changes
37
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
37 changed files
with
168 additions
and
168 deletions
+168
-168
ActiveEntity.php
lib/Doctrine/ActiveEntity.php
+3
-3
ClassMetadata.php
lib/Doctrine/ClassMetadata.php
+1
-1
Factory.php
lib/Doctrine/ClassMetadata/Factory.php
+2
-2
Collection.php
lib/Doctrine/Collection.php
+4
-4
UnitOfWork.php
lib/Doctrine/Connection/UnitOfWork.php
+37
-37
EntityManager.php
lib/Doctrine/EntityManager.php
+7
-7
Entity.php
lib/Doctrine/ORM/Entity.php
+3
-3
Schema.php
lib/Doctrine/ORM/Export/Schema.php
+1
-1
AbstractIdGenerator.php
lib/Doctrine/ORM/Id/AbstractIdGenerator.php
+1
-1
Assigned.php
lib/Doctrine/ORM/Id/Assigned.php
+2
-2
IdentityGenerator.php
lib/Doctrine/ORM/Id/IdentityGenerator.php
+2
-2
SequenceGenerator.php
lib/Doctrine/ORM/Id/SequenceGenerator.php
+2
-2
TableGenerator.php
lib/Doctrine/ORM/Id/TableGenerator.php
+1
-1
Schema.php
lib/Doctrine/ORM/Import/Schema.php
+1
-1
ObjectDriver.php
lib/Doctrine/ORM/Internal/Hydration/ObjectDriver.php
+10
-10
StandardHydrator.php
lib/Doctrine/ORM/Internal/Hydration/StandardHydrator.php
+1
-1
OneToOneMapping.php
lib/Doctrine/ORM/Mapping/OneToOneMapping.php
+1
-1
AbstractEntityPersister.php
lib/Doctrine/ORM/Persisters/AbstractEntityPersister.php
+26
-26
JoinedSubclassPersister.php
lib/Doctrine/ORM/Persisters/JoinedSubclassPersister.php
+6
-6
StandardEntityPersister.php
lib/Doctrine/ORM/Persisters/StandardEntityPersister.php
+5
-5
AbstractSchemaName.php
lib/Doctrine/Query/Parser/AbstractSchemaName.php
+1
-1
AccessorTest.php
tests/Orm/Entity/AccessorTest.php
+2
-2
ConstructorTest.php
tests/Orm/Entity/ConstructorTest.php
+1
-1
BasicHydrationTest.php
tests/Orm/Hydration/BasicHydrationTest.php
+31
-31
UnitOfWorkTest.php
tests/Orm/UnitOfWorkTest.php
+3
-3
Doctrine_EntityPersisterMock.php
tests/lib/mocks/Doctrine_EntityPersisterMock.php
+3
-3
Doctrine_SequenceMock.php
tests/lib/mocks/Doctrine_SequenceMock.php
+1
-1
CmsArticle.php
tests/models/cms/CmsArticle.php
+1
-1
CmsComment.php
tests/models/cms/CmsComment.php
+1
-1
CmsPhonenumber.php
tests/models/cms/CmsPhonenumber.php
+1
-1
CmsUser.php
tests/models/cms/CmsUser.php
+1
-1
CompanyEmployee.php
tests/models/company/CompanyEmployee.php
+1
-1
ForumAvatar.php
tests/models/forum/ForumAvatar.php
+1
-1
ForumBoard.php
tests/models/forum/ForumBoard.php
+1
-1
ForumCategory.php
tests/models/forum/ForumCategory.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/ActiveEntity.php
View file @
18ec38ee
...
...
@@ -10,7 +10,7 @@
*
* @since 2.0
*/
class
Doctrine_ActiveEntity
extends
Doctrine_Entity
class
Doctrine_ActiveEntity
extends
Doctrine_
ORM_
Entity
{
/**
* Saves the current state of the entity into the database.
...
...
@@ -90,7 +90,7 @@ class Doctrine_ActiveEntity extends Doctrine_Entity
// [FIX] Prevent mapped Doctrine_Entitys from being displayed fully
foreach
(
$this
->
_values
as
$key
=>
$value
)
{
if
(
$value
instanceof
Doctrine_Entity
)
{
if
(
$value
instanceof
Doctrine_
ORM_
Entity
)
{
$a
[
$key
]
=
$value
->
toArray
(
$deep
,
$prefixKey
);
}
else
{
$a
[
$key
]
=
$value
;
...
...
@@ -434,7 +434,7 @@ class Doctrine_ActiveEntity extends Doctrine_Entity
$this
->
_extractIdentifier
();
$this
->
_state
=
Doctrine_Entity
::
STATE_CLEAN
;
$this
->
_state
=
Doctrine_
ORM_
Entity
::
STATE_CLEAN
;
return
$this
;
}
...
...
lib/Doctrine/ClassMetadata.php
View file @
18ec38ee
...
...
@@ -1708,7 +1708,7 @@ class Doctrine_ClassMetadata implements Doctrine_Configurable, Serializable
* @param string $event The lifecycle event.
* @param Entity $entity The Entity on which the event occured.
*/
public
function
invokeLifecycleCallbacks
(
$lifecycleEvent
,
Doctrine_Entity
$entity
)
public
function
invokeLifecycleCallbacks
(
$lifecycleEvent
,
Doctrine_
ORM_
Entity
$entity
)
{
foreach
(
$this
->
getLifecycleCallbacks
(
$lifecycleEvent
)
as
$callback
)
{
$entity
->
$callback
();
...
...
lib/Doctrine/ClassMetadata/Factory.php
View file @
18ec38ee
...
...
@@ -86,7 +86,7 @@ class Doctrine_ClassMetadata_Factory
$parentClasses
=
array
();
$loadedParentClass
=
false
;
while
(
$parentClass
=
get_parent_class
(
$parentClass
))
{
if
(
$parentClass
==
'Doctrine_Entity'
)
{
if
(
$parentClass
==
'Doctrine_
ORM_
Entity'
)
{
break
;
}
if
(
isset
(
$classes
[
$parentClass
]))
{
...
...
@@ -177,7 +177,7 @@ class Doctrine_ClassMetadata_Factory
// get parent classes
//TODO: Skip Entity types MappedSuperclass/Transient
do
{
if
(
$className
===
'Doctrine_Entity'
)
{
if
(
$className
===
'Doctrine_
ORM_
Entity'
)
{
break
;
}
else
if
(
$className
==
$name
)
{
continue
;
...
...
lib/Doctrine/Collection.php
View file @
18ec38ee
...
...
@@ -229,7 +229,7 @@ class Doctrine_Collection implements Countable, IteratorAggregate, Serializable,
*
* @return void
*/
public
function
_setOwner
(
Doctrine_Entity
$entity
,
Doctrine_ORM_Mapping_AssociationMapping
$relation
)
public
function
_setOwner
(
Doctrine_
ORM_
Entity
$entity
,
Doctrine_ORM_Mapping_AssociationMapping
$relation
)
{
$this
->
_owner
=
$entity
;
$this
->
_association
=
$relation
;
...
...
@@ -392,7 +392,7 @@ class Doctrine_Collection implements Countable, IteratorAggregate, Serializable,
/**
*
*/
public
function
search
(
Doctrine_Entity
$record
)
public
function
search
(
Doctrine_
ORM_
Entity
$record
)
{
return
array_search
(
$record
,
$this
->
_data
,
true
);
}
...
...
@@ -457,7 +457,7 @@ class Doctrine_Collection implements Countable, IteratorAggregate, Serializable,
*/
public
function
set
(
$key
,
$value
)
{
if
(
!
$value
instanceof
Doctrine_Entity
)
{
if
(
!
$value
instanceof
Doctrine_
ORM_
Entity
)
{
throw
new
Doctrine_Collection_Exception
(
'Value variable in set is not an instance of Doctrine_Entity'
);
}
$this
->
_data
[
$key
]
=
$value
;
...
...
@@ -475,7 +475,7 @@ class Doctrine_Collection implements Countable, IteratorAggregate, Serializable,
public
function
add
(
$value
,
$key
=
null
)
{
//TODO: really only allow entities?
if
(
!
$value
instanceof
Doctrine_Entity
)
{
if
(
!
$value
instanceof
Doctrine_
ORM_
Entity
)
{
throw
new
Doctrine_Record_Exception
(
'Value variable in collection is not an instance of Doctrine_Entity.'
);
}
...
...
lib/Doctrine/Connection/UnitOfWork.php
View file @
18ec38ee
This diff is collapsed.
Click to expand it.
lib/Doctrine/EntityManager.php
View file @
18ec38ee
...
...
@@ -280,7 +280,7 @@ class Doctrine_EntityManager
* @param Doctrine_Entity $entity
* @return unknown
*/
public
function
detach
(
Doctrine_Entity
$entity
)
public
function
detach
(
Doctrine_
ORM_
Entity
$entity
)
{
return
$this
->
_unitOfWork
->
removeFromIdentityMap
(
$entity
);
}
...
...
@@ -431,7 +431,7 @@ class Doctrine_EntityManager
* @param Doctrine::ORM::Entity $entity
* @return void
*/
public
function
save
(
Doctrine_Entity
$entity
)
public
function
save
(
Doctrine_
ORM_
Entity
$entity
)
{
$this
->
_errorIfNotActiveOrClosed
();
$this
->
_unitOfWork
->
save
(
$entity
);
...
...
@@ -446,7 +446,7 @@ class Doctrine_EntityManager
* @param Doctrine::ORM::Entity $entity
* @return void
*/
public
function
delete
(
Doctrine_Entity
$entity
)
public
function
delete
(
Doctrine_
ORM_
Entity
$entity
)
{
$this
->
_errorIfNotActiveOrClosed
();
$this
->
_unitOfWork
->
delete
(
$entity
);
...
...
@@ -463,7 +463,7 @@ class Doctrine_EntityManager
* @return void
* @todo FIX Impl
*/
public
function
refresh
(
Doctrine_Entity
$entity
)
public
function
refresh
(
Doctrine_
ORM_
Entity
$entity
)
{
$this
->
_mergeData
(
$entity
,
$entity
->
getRepository
()
->
find
(
$entity
->
identifier
(),
Doctrine_Query
::
HYDRATE_ARRAY
),
...
...
@@ -476,7 +476,7 @@ class Doctrine_EntityManager
* @param Doctrine::ORM::Entity $entity The entity to copy.
* @return Doctrine::ORM::Entity The new entity.
*/
public
function
copy
(
Doctrine_Entity
$entity
,
$deep
=
false
)
public
function
copy
(
Doctrine_
ORM_
Entity
$entity
,
$deep
=
false
)
{
//...
}
...
...
@@ -560,7 +560,7 @@ class Doctrine_EntityManager
* @param boolean $overrideLocalChanges
* @return void
*/
private
function
_mergeData
(
Doctrine_Entity
$entity
,
array
$data
,
$overrideLocalChanges
=
false
)
{
private
function
_mergeData
(
Doctrine_
ORM_
Entity
$entity
,
array
$data
,
$overrideLocalChanges
=
false
)
{
if
(
$overrideLocalChanges
)
{
foreach
(
$data
as
$field
=>
$value
)
{
$entity
->
_internalSetField
(
$field
,
$value
);
...
...
@@ -582,7 +582,7 @@ class Doctrine_EntityManager
* @return boolean TRUE if this EntityManager currently manages the given entity
* (and has it in the identity map), FALSE otherwise.
*/
public
function
contains
(
Doctrine_Entity
$entity
)
public
function
contains
(
Doctrine_
ORM_
Entity
$entity
)
{
return
$this
->
_unitOfWork
->
isInIdentityMap
(
$entity
)
&&
!
$this
->
_unitOfWork
->
isRegisteredRemoved
(
$entity
);
...
...
lib/Doctrine/Entity.php
→
lib/Doctrine/
ORM/
Entity.php
View file @
18ec38ee
...
...
@@ -40,7 +40,7 @@
* @since 2.0
* @version $Revision: 4342 $
*/
abstract
class
Doctrine_Entity
implements
ArrayAccess
,
Serializable
abstract
class
Doctrine_
ORM_
Entity
implements
ArrayAccess
,
Serializable
{
/**
* MANAGED
...
...
@@ -276,7 +276,7 @@ abstract class Doctrine_Entity implements ArrayAccess, Serializable
$this
->
_data
=
array_merge
(
$this
->
_data
,
$this
->
_id
);
foreach
(
$this
->
_data
as
$k
=>
$v
)
{
if
(
$v
instanceof
Doctrine_Entity
&&
$this
->
_class
->
getTypeOfField
(
$k
)
!=
'object'
)
{
if
(
$v
instanceof
Doctrine_
ORM_
Entity
&&
$this
->
_class
->
getTypeOfField
(
$k
)
!=
'object'
)
{
unset
(
$vars
[
'_data'
][
$k
]);
}
else
if
(
$v
===
Doctrine_Null
::
$INSTANCE
)
{
unset
(
$vars
[
'_data'
][
$k
]);
...
...
@@ -541,7 +541,7 @@ abstract class Doctrine_Entity implements ArrayAccess, Serializable
$rel
=
$this
->
_class
->
getAssociationMapping
(
$name
);
if
(
$rel
->
isOneToOne
()
&&
!
$value
instanceof
Doctrine_Entity
)
{
if
(
$rel
->
isOneToOne
()
&&
!
$value
instanceof
Doctrine_
ORM_
Entity
)
{
throw
Doctrine_Entity_Exception
::
invalidValueForOneToOneReference
();
}
else
if
((
$rel
->
isOneToMany
()
||
$rel
->
isManyToMany
())
&&
!
$value
instanceof
Doctrine_Collection
)
{
throw
Doctrine_Entity_Exception
::
invalidValueForOneToManyReference
();
...
...
lib/Doctrine/ORM/Export/Schema.php
View file @
18ec38ee
...
...
@@ -52,7 +52,7 @@ class Doctrine_Export_Schema
$array
=
array
();
$parent
=
new
ReflectionClass
(
'Doctrine_Entity'
);
$parent
=
new
ReflectionClass
(
'Doctrine_
ORM_
Entity'
);
$sql
=
array
();
$fks
=
array
();
...
...
lib/Doctrine/ORM/Id/AbstractIdGenerator.php
View file @
18ec38ee
...
...
@@ -18,7 +18,7 @@ abstract class Doctrine_ORM_Id_AbstractIdGenerator
$this
->
_em
=
$em
;
}
abstract
public
function
generate
(
Doctrine_Entity
$entity
);
abstract
public
function
generate
(
Doctrine_
ORM_
Entity
$entity
);
}
?>
\ No newline at end of file
lib/Doctrine/ORM/Id/Assigned.php
View file @
18ec38ee
...
...
@@ -10,11 +10,11 @@ class Doctrine_ORM_Id_Assigned extends Doctrine_ORM_Id_AbstractIdGenerator
/**
* Enter description here...
*
* @param Doctrine_Entity $entity
* @param Doctrine_
ORM_
Entity $entity
* @return unknown
* @override
*/
public
function
generate
(
Doctrine_Entity
$entity
)
public
function
generate
(
Doctrine_
ORM_
Entity
$entity
)
{
if
(
!
$entity
->
_identifier
())
{
throw
Doctrine_IdException
::
missingAssignedId
(
$entity
);
...
...
lib/Doctrine/ORM/Id/IdentityGenerator.php
View file @
18ec38ee
...
...
@@ -5,11 +5,11 @@ class Doctrine_ORM_Id_IdentityGenerator extends Doctrine_ORM_Id_AbstractIdGenera
/**
* Enter description here...
*
* @param Doctrine_Entity $entity
* @param Doctrine_
ORM_
Entity $entity
* @return unknown
* @override
*/
public
function
generate
(
Doctrine_Entity
$entity
)
public
function
generate
(
Doctrine_
ORM_
Entity
$entity
)
{
return
self
::
POST_INSERT_INDICATOR
;
}
...
...
lib/Doctrine/ORM/Id/SequenceGenerator.php
View file @
18ec38ee
...
...
@@ -12,10 +12,10 @@ class Doctrine_ORM_Id_SequenceGenerator extends Doctrine_ORM_Id_AbstractIdGenera
/**
* Enter description here...
*
* @param Doctrine_Entity $entity
* @param Doctrine_
ORM_
Entity $entity
* @override
*/
public
function
generate
(
Doctrine_Entity
$entity
)
public
function
generate
(
Doctrine_
ORM_
Entity
$entity
)
{
$conn
=
$this
->
_em
->
getConnection
();
$sql
=
$conn
->
getDatabasePlatform
()
->
getSequenceNextValSql
(
$this
->
_sequenceName
);
...
...
lib/Doctrine/ORM/Id/TableGenerator.php
View file @
18ec38ee
...
...
@@ -8,7 +8,7 @@
class
Doctrine_ORM_Id_TableGenerator
extends
Doctrine_ORM_Id_AbstractIdGenerator
{
public
function
generate
(
Doctrine_Entity
$entity
)
public
function
generate
(
Doctrine_
ORM_
Entity
$entity
)
{
throw
new
Exception
(
"Not implemented"
);
}
...
...
lib/Doctrine/ORM/Import/Schema.php
View file @
18ec38ee
...
...
@@ -44,7 +44,7 @@ class Doctrine_Import_Schema
'packagesPath'
=>
''
,
'generateBaseClasses'
=>
true
,
'baseClassesDirectory'
=>
'generated'
,
'baseClassName'
=>
'Doctrine_Entity'
,
'baseClassName'
=>
'Doctrine_
ORM_
Entity'
,
'suffix'
=>
'.php'
);
/**
...
...
lib/Doctrine/ORM/Internal/Hydration/ObjectDriver.php
View file @
18ec38ee
...
...
@@ -67,7 +67,7 @@ class Doctrine_ORM_Internal_Hydration_ObjectDriver
}
}
public
function
initRelatedCollection
(
Doctrine_Entity
$entity
,
$name
)
public
function
initRelatedCollection
(
Doctrine_
ORM_
Entity
$entity
,
$name
)
{
if
(
!
isset
(
$this
->
_initializedRelations
[
$entity
->
getOid
()][
$name
]))
{
$relation
=
$entity
->
getClass
()
->
getAssociationMapping
(
$name
);
...
...
@@ -95,39 +95,39 @@ class Doctrine_ORM_Internal_Hydration_ObjectDriver
return
$this
->
_em
->
createEntity
(
$className
,
$data
);
}
public
function
addRelatedIndexedElement
(
Doctrine_Entity
$entity1
,
$property
,
Doctrine_Entity
$entity2
,
$indexField
)
public
function
addRelatedIndexedElement
(
Doctrine_
ORM_
Entity
$entity1
,
$property
,
Doctrine_
ORM_
Entity
$entity2
,
$indexField
)
{
$entity1
->
_internalGetReference
(
$property
)
->
add
(
$entity2
,
$entity2
->
_internalGetField
(
$indexField
));
}
public
function
addRelatedElement
(
Doctrine_Entity
$entity1
,
$property
,
Doctrine_Entity
$entity2
)
public
function
addRelatedElement
(
Doctrine_
ORM_
Entity
$entity1
,
$property
,
Doctrine_
ORM_
Entity
$entity2
)
{
$entity1
->
_internalGetReference
(
$property
)
->
add
(
$entity2
);
}
public
function
setRelatedElement
(
Doctrine_Entity
$entity1
,
$property
,
$entity2
)
public
function
setRelatedElement
(
Doctrine_
ORM_
Entity
$entity1
,
$property
,
$entity2
)
{
$entity1
->
_internalSetReference
(
$property
,
$entity2
,
true
);
}
public
function
isIndexKeyInUse
(
Doctrine_Entity
$entity
,
$assocField
,
$indexField
)
public
function
isIndexKeyInUse
(
Doctrine_
ORM_
Entity
$entity
,
$assocField
,
$indexField
)
{
return
$entity
->
_internalGetReference
(
$assocField
)
->
contains
(
$indexField
);
}
public
function
isFieldSet
(
Doctrine_Entity
$entity
,
$field
)
public
function
isFieldSet
(
Doctrine_
ORM_
Entity
$entity
,
$field
)
{
return
$entity
->
contains
(
$field
);
}
public
function
getFieldValue
(
Doctrine_Entity
$entity
,
$field
)
public
function
getFieldValue
(
Doctrine_
ORM_
Entity
$entity
,
$field
)
{
return
$entity
->
_internalGetField
(
$field
);
}
public
function
getReferenceValue
(
Doctrine_Entity
$entity
,
$field
)
public
function
getReferenceValue
(
Doctrine_
ORM_
Entity
$entity
,
$field
)
{
return
$entity
->
_internalGetReference
(
$field
);
}
...
...
lib/Doctrine/ORM/Internal/Hydration/StandardHydrator.php
View file @
18ec38ee
...
...
@@ -317,7 +317,7 @@ class Doctrine_ORM_Internal_Hydration_StandardHydrator extends Doctrine_ORM_Inte
end
(
$coll
);
$resultPointers
[
$dqlAlias
]
=&
$coll
[
key
(
$coll
)];
}
}
else
if
(
$coll
instanceof
Doctrine_Entity
)
{
}
else
if
(
$coll
instanceof
Doctrine_
ORM_
Entity
)
{
$resultPointers
[
$dqlAlias
]
=
$coll
;
}
else
if
(
count
(
$coll
)
>
0
)
{
$resultPointers
[
$dqlAlias
]
=
$coll
->
getLast
();
...
...
lib/Doctrine/ORM/Mapping/OneToOneMapping.php
View file @
18ec38ee
...
...
@@ -133,7 +133,7 @@ class Doctrine_ORM_Mapping_OneToOneMapping extends Doctrine_ORM_Mapping_Associat
* @param Doctrine::ORM::Entity $entity
* @return void
*/
public
function
lazyLoadFor
(
Doctrine_Entity
$entity
)
public
function
lazyLoadFor
(
Doctrine_
ORM_
Entity
$entity
)
{
if
(
$entity
->
getClassName
()
!=
$this
->
_sourceClass
->
getClassName
())
{
//error?
...
...
lib/Doctrine/ORM/Persisters/AbstractEntityPersister.php
View file @
18ec38ee
...
...
@@ -89,7 +89,7 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister
* @param Doctrine::ORM::Entity $entity The entity to insert.
* @return void
*/
public
function
insert
(
Doctrine_Entity
$entity
)
public
function
insert
(
Doctrine_
ORM_
Entity
$entity
)
{
$insertData
=
array
();
$class
=
$entity
->
getClass
();
...
...
@@ -149,7 +149,7 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister
* @param Doctrine::ORM::Entity $entity The entity to update.
* @return void
*/
public
function
update
(
Doctrine_Entity
$entity
)
public
function
update
(
Doctrine_
ORM_
Entity
$entity
)
{
$dataChangeSet
=
$entity
->
_getDataChangeSet
();
$referenceChangeSet
=
$entity
->
_getReferenceChangeSet
();
...
...
@@ -175,7 +175,7 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister
* @param Doctrine::ORM::Entity $entity The entity to delete.
* @return void
*/
public
function
delete
(
Doctrine_Entity
$entity
)
public
function
delete
(
Doctrine_
ORM_
Entity
$entity
)
{
//TODO: perform delete
}
...
...
@@ -334,14 +334,14 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister
* @throws PDOException if something went wrong at database level
* @return void
*/
protected
function
_deleteComposites
(
Doctrine_Entity
$record
)
protected
function
_deleteComposites
(
Doctrine_
ORM_
Entity
$record
)
{
$classMetadata
=
$this
->
_classMetadata
;
foreach
(
$classMetadata
->
getRelations
()
as
$fk
)
{
if
(
$fk
->
isComposite
())
{
$obj
=
$record
->
get
(
$fk
->
getAlias
());
if
(
$obj
instanceof
Doctrine_Entity
&&
$obj
->
_state
()
!=
Doctrine_Entity
::
STATE_LOCKED
)
{
if
(
$obj
instanceof
Doctrine_
ORM_
Entity
&&
$obj
->
_state
()
!=
Doctrine_
ORM_
Entity
::
STATE_LOCKED
)
{
$obj
->
delete
(
$this
->
_mapper
->
getConnection
());
}
}
...
...
@@ -381,7 +381,7 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister
* @param Doctrine_Connection $conn The connection to use. Will default to the mapper's
* connection.
*/
public
function
save
(
Doctrine_Entity
$record
)
public
function
save
(
Doctrine_
ORM_
Entity
$record
)
{
if
(
!
(
$record
instanceof
$this
->
_domainClassName
))
{
throw
new
Doctrine_Mapper_Exception
(
"Mapper of type "
.
$this
->
_domainClassName
.
"
...
...
@@ -393,11 +393,11 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister
}
$state
=
$record
->
_state
();
if
(
$state
===
Doctrine_Entity
::
STATE_LOCKED
)
{
if
(
$state
===
Doctrine_
ORM_
Entity
::
STATE_LOCKED
)
{
return
false
;
}
$record
->
_state
(
Doctrine_Entity
::
STATE_LOCKED
);
$record
->
_state
(
Doctrine_
ORM_
Entity
::
STATE_LOCKED
);
try
{
$conn
->
beginInternalTransaction
();
...
...
@@ -412,7 +412,7 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister
}
$state
=
$record
->
_state
();
$record
->
_state
(
Doctrine_Entity
::
STATE_LOCKED
);
$record
->
_state
(
Doctrine_
ORM_
Entity
::
STATE_LOCKED
);
foreach
(
$saveLater
as
$fk
)
{
$alias
=
$fk
->
getAlias
();
...
...
@@ -443,21 +443,21 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister
*
* @param Doctrine_Entity $record The entity to insert/update.
*/
protected
function
_insertOrUpdate
(
Doctrine_Entity
$record
)
protected
function
_insertOrUpdate
(
Doctrine_
ORM_
Entity
$record
)
{
//$record->preSave();
//$this->notifyEntityListeners($record, 'preSave', Doctrine_Event::RECORD_SAVE);
switch
(
$record
->
_state
())
{
case
Doctrine_Entity
::
STATE_TDIRTY
:
case
Doctrine_
ORM_
Entity
::
STATE_TDIRTY
:
$this
->
_insert
(
$record
);
break
;
case
Doctrine_Entity
::
STATE_DIRTY
:
case
Doctrine_Entity
::
STATE_PROXY
:
case
Doctrine_
ORM_
Entity
::
STATE_DIRTY
:
case
Doctrine_
ORM_
Entity
::
STATE_PROXY
:
$this
->
_update
(
$record
);
break
;
case
Doctrine_Entity
::
STATE_CLEAN
:
case
Doctrine_Entity
::
STATE_TCLEAN
:
case
Doctrine_
ORM_
Entity
::
STATE_CLEAN
:
case
Doctrine_
ORM_
Entity
::
STATE_TCLEAN
:
// do nothing
break
;
}
...
...
@@ -472,7 +472,7 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister
* @param Doctrine_Entity $record
* @return void
*/
public
function
saveSingleRecord
(
Doctrine_Entity
$record
)
public
function
saveSingleRecord
(
Doctrine_
ORM_
Entity
$record
)
{
$this
->
_insertOrUpdate
(
$record
);
}
...
...
@@ -483,7 +483,7 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister
* @throws PDOException if something went wrong at database level
* @param Doctrine_Entity $record
*/
protected
function
_saveRelated
(
Doctrine_Entity
$record
)
protected
function
_saveRelated
(
Doctrine_
ORM_
Entity
$record
)
{
$saveLater
=
array
();
foreach
(
$record
->
_getReferences
()
as
$k
=>
$v
)
{
...
...
@@ -499,7 +499,7 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister
$obj
=
$record
->
get
(
$rel
->
getAlias
());
// Protection against infinite function recursion before attempting to save
if
(
$obj
instanceof
Doctrine_Entity
&&
$obj
->
isModified
())
{
if
(
$obj
instanceof
Doctrine_
ORM_
Entity
&&
$obj
->
isModified
())
{
$obj
->
save
();
/** Can this be removed?
...
...
@@ -531,7 +531,7 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister
* @param Doctrine_Entity $record
* @return void
*/
public
function
saveAssociations
(
Doctrine_Entity
$record
)
public
function
saveAssociations
(
Doctrine_
ORM_
Entity
$record
)
{
foreach
(
$record
->
_getReferences
()
as
$relationName
=>
$relatedObject
)
{
if
(
$relatedObject
===
Doctrine_Null
::
$INSTANCE
)
{
...
...
@@ -573,7 +573,7 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister
* @return boolean whether or not the update was successful
* @todo Move to Doctrine_Table (which will become Doctrine_Mapper).
*/
protected
function
_update
(
Doctrine_Entity
$record
)
protected
function
_update
(
Doctrine_
ORM_
Entity
$record
)
{
$record
->
preUpdate
();
$this
->
notifyEntityListeners
(
$record
,
'preUpdate'
,
Doctrine_Event
::
RECORD_UPDATE
);
...
...
@@ -587,7 +587,7 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister
return
true
;
}
abstract
protected
function
_doUpdate
(
Doctrine_Entity
$entity
);
abstract
protected
function
_doUpdate
(
Doctrine_
ORM_
Entity
$entity
);
/**
* Inserts an entity.
...
...
@@ -595,7 +595,7 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister
* @param Doctrine_Entity $record record to be inserted
* @return boolean
*/
protected
function
_insert
(
Doctrine_Entity
$record
)
protected
function
_insert
(
Doctrine_
ORM_
Entity
$record
)
{
$record
->
preInsert
();
$this
->
notifyEntityListeners
(
$record
,
'preInsert'
,
Doctrine_Event
::
RECORD_INSERT
);
...
...
@@ -609,7 +609,7 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister
return
true
;
}
abstract
protected
function
_doInsert
(
Doctrine_Entity
$entity
);
abstract
protected
function
_doInsert
(
Doctrine_
ORM_
Entity
$entity
);
/**
* Deletes given entity and all it's related entities.
...
...
@@ -619,7 +619,7 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister
* @return boolean true on success, false on failure
* @throws Doctrine_Mapper_Exception
*/
public
function
delete_old
(
Doctrine_Entity
$record
)
public
function
delete_old
(
Doctrine_
ORM_
Entity
$record
)
{
if
(
!
$record
->
exists
())
{
return
false
;
...
...
@@ -640,7 +640,7 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister
$table
=
$this
->
_classMetadata
;
$state
=
$record
->
_state
();
$record
->
_state
(
Doctrine_Entity
::
STATE_LOCKED
);
$record
->
_state
(
Doctrine_
ORM_
Entity
::
STATE_LOCKED
);
$this
->
_doDelete
(
$record
);
...
...
lib/Doctrine/ORM/Persisters/JoinedSubclassPersister.php
View file @
18ec38ee
...
...
@@ -38,7 +38,7 @@ class Doctrine_ORM_Persisters_JoinedSubclassPersister extends Doctrine_ORM_Persi
* @return boolean
* @override
*/
public
function
insert
(
Doctrine_Entity
$entity
)
public
function
insert
(
Doctrine_
ORM_
Entity
$entity
)
{
$class
=
$entity
->
getClass
();
...
...
@@ -88,7 +88,7 @@ class Doctrine_ORM_Persisters_JoinedSubclassPersister extends Doctrine_ORM_Persi
* @param Doctrine_Entity $record record to be updated
* @return boolean whether or not the update was successful
*/
protected
function
_doUpdate
(
Doctrine_Entity
$record
)
protected
function
_doUpdate
(
Doctrine_
ORM_
Entity
$record
)
{
$conn
=
$this
->
_conn
;
$classMetadata
=
$this
->
_classMetadata
;
...
...
@@ -99,7 +99,7 @@ class Doctrine_ORM_Persisters_JoinedSubclassPersister extends Doctrine_ORM_Persi
array_unshift
(
$classes
,
$component
);
foreach
(
$record
as
$field
=>
$value
)
{
if
(
$value
instanceof
Doctrine_Entity
)
{
if
(
$value
instanceof
Doctrine_
ORM_
Entity
)
{
if
(
!
$value
->
exists
())
{
$value
->
save
();
}
...
...
@@ -122,7 +122,7 @@ class Doctrine_ORM_Persisters_JoinedSubclassPersister extends Doctrine_ORM_Persi
* Deletes an entity that is part of a Class Table Inheritance hierarchy.
*
*/
protected
function
_doDelete
(
Doctrine_Entity
$record
)
protected
function
_doDelete
(
Doctrine_
ORM_
Entity
$record
)
{
$conn
=
$this
->
_conn
;
try
{
...
...
@@ -130,7 +130,7 @@ class Doctrine_ORM_Persisters_JoinedSubclassPersister extends Doctrine_ORM_Persi
$conn
->
beginInternalTransaction
();
$this
->
_deleteComposites
(
$record
);
$record
->
_state
(
Doctrine_Entity
::
STATE_TDIRTY
);
$record
->
_state
(
Doctrine_
ORM_
Entity
::
STATE_TDIRTY
);
$identifier
=
$this
->
_convertFieldToColumnNames
(
$record
->
identifier
(),
$class
);
...
...
@@ -141,7 +141,7 @@ class Doctrine_ORM_Persisters_JoinedSubclassPersister extends Doctrine_ORM_Persi
$this
->
_deleteRow
(
$parentClass
->
getTableName
(),
$identifier
);
}
$record
->
_state
(
Doctrine_Entity
::
STATE_TCLEAN
);
$record
->
_state
(
Doctrine_
ORM_
Entity
::
STATE_TCLEAN
);
$this
->
removeRecord
(
$record
);
// @todo should be done in the unitofwork
$conn
->
commit
();
...
...
lib/Doctrine/ORM/Persisters/StandardEntityPersister.php
View file @
18ec38ee
...
...
@@ -34,7 +34,7 @@ class Doctrine_ORM_Persisters_StandardEntityPersister extends Doctrine_ORM_Persi
/**
* Deletes an entity.
*/
protected
function
_doDelete
(
Doctrine_Entity
$record
)
protected
function
_doDelete
(
Doctrine_
ORM_
Entity
$record
)
{
$conn
=
$this
->
_conn
;
$metadata
=
$this
->
_classMetadata
;
...
...
@@ -42,11 +42,11 @@ class Doctrine_ORM_Persisters_StandardEntityPersister extends Doctrine_ORM_Persi
$conn
->
beginInternalTransaction
();
$this
->
_deleteComposites
(
$record
);
$record
->
_state
(
Doctrine_Entity
::
STATE_TDIRTY
);
$record
->
_state
(
Doctrine_
ORM_
Entity
::
STATE_TDIRTY
);
$identifier
=
$this
->
_convertFieldToColumnNames
(
$record
->
identifier
(),
$metadata
);
$this
->
_deleteRow
(
$metadata
->
getTableName
(),
$identifier
);
$record
->
_state
(
Doctrine_Entity
::
STATE_TCLEAN
);
$record
->
_state
(
Doctrine_
ORM_
Entity
::
STATE_TCLEAN
);
$this
->
removeRecord
(
$record
);
$conn
->
commit
();
...
...
@@ -61,7 +61,7 @@ class Doctrine_ORM_Persisters_StandardEntityPersister extends Doctrine_ORM_Persi
*
* @param Doctrine_Entity $record The entity to insert.
*/
protected
function
_doInsert
(
Doctrine_Entity
$record
)
protected
function
_doInsert
(
Doctrine_
ORM_
Entity
$record
)
{
$conn
=
$this
->
_conn
;
...
...
@@ -105,7 +105,7 @@ class Doctrine_ORM_Persisters_StandardEntityPersister extends Doctrine_ORM_Persi
/**
* Updates an entity.
*/
protected
function
_doUpdate
(
Doctrine_Entity
$record
)
protected
function
_doUpdate
(
Doctrine_
ORM_
Entity
$record
)
{
$conn
=
$this
->
_conn
;
$classMetadata
=
$this
->
_classMetadata
;
...
...
lib/Doctrine/Query/Parser/AbstractSchemaName.php
View file @
18ec38ee
...
...
@@ -66,7 +66,7 @@ class Doctrine_Query_Parser_AbstractSchemaName extends Doctrine_Query_ParserRule
{
if
(
class_exists
(
$componentName
))
{
$reflectionClass
=
new
ReflectionClass
(
$componentName
);
$dctrnEntityReflectionClass
=
new
ReflectionClass
(
'Doctrine_Entity'
);
$dctrnEntityReflectionClass
=
new
ReflectionClass
(
'Doctrine_
ORM_
Entity'
);
return
$reflectionClass
->
isSubclassOf
(
$dctrnEntityReflectionClass
);
}
...
...
tests/Orm/Entity/AccessorTest.php
View file @
18ec38ee
...
...
@@ -18,7 +18,7 @@ class Orm_Entity_AccessorTest extends Doctrine_OrmTestCase
/* Local test classes */
class
CustomAccessorMutatorTestEntity
extends
Doctrine_Entity
class
CustomAccessorMutatorTestEntity
extends
Doctrine_
ORM_
Entity
{
public
static
function
initMetadata
(
$mapping
)
{
...
...
@@ -48,7 +48,7 @@ class CustomAccessorMutatorTestEntity extends Doctrine_Entity
}
}
class
MagicAccessorMutatorTestEntity
extends
Doctrine_Entity
class
MagicAccessorMutatorTestEntity
extends
Doctrine_
ORM_
Entity
{
public
static
function
initMetadata
(
$mapping
)
{
...
...
tests/Orm/Entity/ConstructorTest.php
View file @
18ec38ee
...
...
@@ -11,7 +11,7 @@ class Orm_Entity_ConstructorTest extends Doctrine_OrmTestCase
}
}
class
ConstructorTestEntity1
extends
Doctrine_Entity
class
ConstructorTestEntity1
extends
Doctrine_
ORM_
Entity
{
public
function
__construct
(
$username
=
null
)
{
...
...
tests/Orm/Hydration/BasicHydrationTest.php
View file @
18ec38ee
...
...
@@ -86,8 +86,8 @@ class Orm_Hydration_BasicHydrationTest extends Doctrine_OrmTestCase
if
(
$hydrationMode
==
Doctrine
::
HYDRATE_RECORD
)
{
$this
->
assertTrue
(
$result
instanceof
Doctrine_Collection
);
$this
->
assertTrue
(
$result
[
0
]
instanceof
Doctrine_Entity
);
$this
->
assertTrue
(
$result
[
1
]
instanceof
Doctrine_Entity
);
$this
->
assertTrue
(
$result
[
0
]
instanceof
Doctrine_
ORM_
Entity
);
$this
->
assertTrue
(
$result
[
1
]
instanceof
Doctrine_
ORM_
Entity
);
}
else
if
(
$hydrationMode
==
Doctrine
::
HYDRATE_ARRAY
)
{
$this
->
assertTrue
(
is_array
(
$result
));
}
else
if
(
$hydrationMode
==
Doctrine
::
HYDRATE_SCALAR
)
{
...
...
@@ -186,11 +186,11 @@ class Orm_Hydration_BasicHydrationTest extends Doctrine_OrmTestCase
}
if
(
$hydrationMode
==
Doctrine
::
HYDRATE_RECORD
)
{
$this
->
assertTrue
(
$result
[
0
][
0
]
instanceof
Doctrine_Entity
);
$this
->
assertTrue
(
$result
[
0
][
0
]
instanceof
Doctrine_
ORM_
Entity
);
$this
->
assertTrue
(
$result
[
0
][
0
][
'phonenumbers'
]
instanceof
Doctrine_Collection
);
$this
->
assertTrue
(
$result
[
0
][
0
][
'phonenumbers'
][
0
]
instanceof
Doctrine_Entity
);
$this
->
assertTrue
(
$result
[
0
][
0
][
'phonenumbers'
][
1
]
instanceof
Doctrine_Entity
);
$this
->
assertTrue
(
$result
[
1
][
0
]
instanceof
Doctrine_Entity
);
$this
->
assertTrue
(
$result
[
0
][
0
][
'phonenumbers'
][
0
]
instanceof
Doctrine_
ORM_
Entity
);
$this
->
assertTrue
(
$result
[
0
][
0
][
'phonenumbers'
][
1
]
instanceof
Doctrine_
ORM_
Entity
);
$this
->
assertTrue
(
$result
[
1
][
0
]
instanceof
Doctrine_
ORM_
Entity
);
$this
->
assertTrue
(
$result
[
1
][
0
][
'phonenumbers'
]
instanceof
Doctrine_Collection
);
}
else
if
(
$hydrationMode
==
Doctrine
::
HYDRATE_SCALAR
)
{
$this
->
assertTrue
(
is_array
(
$result
));
...
...
@@ -273,8 +273,8 @@ class Orm_Hydration_BasicHydrationTest extends Doctrine_OrmTestCase
}
if
(
$hydrationMode
==
Doctrine
::
HYDRATE_RECORD
)
{
$this
->
assertTrue
(
$result
[
0
][
0
]
instanceof
Doctrine_Entity
);
$this
->
assertTrue
(
$result
[
1
][
0
]
instanceof
Doctrine_Entity
);
$this
->
assertTrue
(
$result
[
0
][
0
]
instanceof
Doctrine_
ORM_
Entity
);
$this
->
assertTrue
(
$result
[
1
][
0
]
instanceof
Doctrine_
ORM_
Entity
);
}
else
if
(
$hydrationMode
==
Doctrine
::
HYDRATE_SCALAR
)
{
$this
->
assertEquals
(
2
,
count
(
$result
));
...
...
@@ -377,8 +377,8 @@ class Orm_Hydration_BasicHydrationTest extends Doctrine_OrmTestCase
}
if
(
$hydrationMode
==
Doctrine
::
HYDRATE_RECORD
)
{
$this
->
assertTrue
(
$result
[
0
][
'1'
]
instanceof
Doctrine_Entity
);
$this
->
assertTrue
(
$result
[
1
][
'2'
]
instanceof
Doctrine_Entity
);
$this
->
assertTrue
(
$result
[
0
][
'1'
]
instanceof
Doctrine_
ORM_
Entity
);
$this
->
assertTrue
(
$result
[
1
][
'2'
]
instanceof
Doctrine_
ORM_
Entity
);
$this
->
assertTrue
(
$result
[
0
][
'1'
][
'phonenumbers'
]
instanceof
Doctrine_Collection
);
$this
->
assertEquals
(
2
,
count
(
$result
[
0
][
'1'
][
'phonenumbers'
]));
}
else
if
(
$hydrationMode
==
Doctrine
::
HYDRATE_SCALAR
)
{
...
...
@@ -521,18 +521,18 @@ class Orm_Hydration_BasicHydrationTest extends Doctrine_OrmTestCase
}
if
(
$hydrationMode
==
Doctrine
::
HYDRATE_RECORD
)
{
$this
->
assertTrue
(
$result
[
0
][
0
]
instanceof
Doctrine_Entity
);
$this
->
assertTrue
(
$result
[
0
][
0
]
instanceof
Doctrine_
ORM_
Entity
);
$this
->
assertTrue
(
$result
[
0
][
0
][
'phonenumbers'
]
instanceof
Doctrine_Collection
);
$this
->
assertTrue
(
$result
[
0
][
0
][
'phonenumbers'
][
0
]
instanceof
Doctrine_Entity
);
$this
->
assertTrue
(
$result
[
0
][
0
][
'phonenumbers'
][
1
]
instanceof
Doctrine_Entity
);
$this
->
assertTrue
(
$result
[
0
][
0
][
'phonenumbers'
][
0
]
instanceof
Doctrine_
ORM_
Entity
);
$this
->
assertTrue
(
$result
[
0
][
0
][
'phonenumbers'
][
1
]
instanceof
Doctrine_
ORM_
Entity
);
$this
->
assertTrue
(
$result
[
0
][
0
][
'articles'
]
instanceof
Doctrine_Collection
);
$this
->
assertTrue
(
$result
[
0
][
0
][
'articles'
][
0
]
instanceof
Doctrine_Entity
);
$this
->
assertTrue
(
$result
[
0
][
0
][
'articles'
][
1
]
instanceof
Doctrine_Entity
);
$this
->
assertTrue
(
$result
[
1
][
0
]
instanceof
Doctrine_Entity
);
$this
->
assertTrue
(
$result
[
0
][
0
][
'articles'
][
0
]
instanceof
Doctrine_
ORM_
Entity
);
$this
->
assertTrue
(
$result
[
0
][
0
][
'articles'
][
1
]
instanceof
Doctrine_
ORM_
Entity
);
$this
->
assertTrue
(
$result
[
1
][
0
]
instanceof
Doctrine_
ORM_
Entity
);
$this
->
assertTrue
(
$result
[
1
][
0
][
'phonenumbers'
]
instanceof
Doctrine_Collection
);
$this
->
assertTrue
(
$result
[
1
][
0
][
'phonenumbers'
][
0
]
instanceof
Doctrine_Entity
);
$this
->
assertTrue
(
$result
[
1
][
0
][
'articles'
][
0
]
instanceof
Doctrine_Entity
);
$this
->
assertTrue
(
$result
[
1
][
0
][
'articles'
][
1
]
instanceof
Doctrine_Entity
);
$this
->
assertTrue
(
$result
[
1
][
0
][
'phonenumbers'
][
0
]
instanceof
Doctrine_
ORM_
Entity
);
$this
->
assertTrue
(
$result
[
1
][
0
][
'articles'
][
0
]
instanceof
Doctrine_
ORM_
Entity
);
$this
->
assertTrue
(
$result
[
1
][
0
][
'articles'
][
1
]
instanceof
Doctrine_
ORM_
Entity
);
}
else
if
(
$hydrationMode
==
Doctrine
::
HYDRATE_SCALAR
)
{
//...
$this
->
assertEquals
(
6
,
count
(
$result
));
...
...
@@ -705,23 +705,23 @@ class Orm_Hydration_BasicHydrationTest extends Doctrine_OrmTestCase
}
if
(
$hydrationMode
==
Doctrine
::
HYDRATE_RECORD
)
{
$this
->
assertTrue
(
$result
[
0
][
0
]
instanceof
Doctrine_Entity
);
$this
->
assertTrue
(
$result
[
1
][
0
]
instanceof
Doctrine_Entity
);
$this
->
assertTrue
(
$result
[
0
][
0
]
instanceof
Doctrine_
ORM_
Entity
);
$this
->
assertTrue
(
$result
[
1
][
0
]
instanceof
Doctrine_
ORM_
Entity
);
// phonenumbers
$this
->
assertTrue
(
$result
[
0
][
0
][
'phonenumbers'
]
instanceof
Doctrine_Collection
);
$this
->
assertTrue
(
$result
[
0
][
0
][
'phonenumbers'
][
0
]
instanceof
Doctrine_Entity
);
$this
->
assertTrue
(
$result
[
0
][
0
][
'phonenumbers'
][
1
]
instanceof
Doctrine_Entity
);
$this
->
assertTrue
(
$result
[
0
][
0
][
'phonenumbers'
][
0
]
instanceof
Doctrine_
ORM_
Entity
);
$this
->
assertTrue
(
$result
[
0
][
0
][
'phonenumbers'
][
1
]
instanceof
Doctrine_
ORM_
Entity
);
$this
->
assertTrue
(
$result
[
1
][
0
][
'phonenumbers'
]
instanceof
Doctrine_Collection
);
$this
->
assertTrue
(
$result
[
1
][
0
][
'phonenumbers'
][
0
]
instanceof
Doctrine_Entity
);
$this
->
assertTrue
(
$result
[
1
][
0
][
'phonenumbers'
][
0
]
instanceof
Doctrine_
ORM_
Entity
);
// articles
$this
->
assertTrue
(
$result
[
0
][
0
][
'articles'
]
instanceof
Doctrine_Collection
);
$this
->
assertTrue
(
$result
[
0
][
0
][
'articles'
][
0
]
instanceof
Doctrine_Entity
);
$this
->
assertTrue
(
$result
[
0
][
0
][
'articles'
][
1
]
instanceof
Doctrine_Entity
);
$this
->
assertTrue
(
$result
[
1
][
0
][
'articles'
][
0
]
instanceof
Doctrine_Entity
);
$this
->
assertTrue
(
$result
[
1
][
0
][
'articles'
][
1
]
instanceof
Doctrine_Entity
);
$this
->
assertTrue
(
$result
[
0
][
0
][
'articles'
][
0
]
instanceof
Doctrine_
ORM_
Entity
);
$this
->
assertTrue
(
$result
[
0
][
0
][
'articles'
][
1
]
instanceof
Doctrine_
ORM_
Entity
);
$this
->
assertTrue
(
$result
[
1
][
0
][
'articles'
][
0
]
instanceof
Doctrine_
ORM_
Entity
);
$this
->
assertTrue
(
$result
[
1
][
0
][
'articles'
][
1
]
instanceof
Doctrine_
ORM_
Entity
);
// article comments
$this
->
assertTrue
(
$result
[
0
][
0
][
'articles'
][
0
][
'comments'
]
instanceof
Doctrine_Collection
);
$this
->
assertTrue
(
$result
[
0
][
0
][
'articles'
][
0
][
'comments'
][
0
]
instanceof
Doctrine_Entity
);
$this
->
assertTrue
(
$result
[
0
][
0
][
'articles'
][
0
][
'comments'
][
0
]
instanceof
Doctrine_
ORM_
Entity
);
// empty comment collections
$this
->
assertTrue
(
$result
[
0
][
0
][
'articles'
][
1
][
'comments'
]
instanceof
Doctrine_Collection
);
$this
->
assertEquals
(
0
,
count
(
$result
[
0
][
0
][
'articles'
][
1
][
'comments'
]));
...
...
@@ -849,8 +849,8 @@ class Orm_Hydration_BasicHydrationTest extends Doctrine_OrmTestCase
$this
->
assertTrue
(
is_array
(
$result
[
1
]));
}
else
if
(
$hydrationMode
==
Doctrine
::
HYDRATE_RECORD
)
{
$this
->
assertTrue
(
$result
instanceof
Doctrine_Collection
);
$this
->
assertTrue
(
$result
[
0
]
instanceof
Doctrine_Entity
);
$this
->
assertTrue
(
$result
[
1
]
instanceof
Doctrine_Entity
);
$this
->
assertTrue
(
$result
[
0
]
instanceof
Doctrine_
ORM_
Entity
);
$this
->
assertTrue
(
$result
[
1
]
instanceof
Doctrine_
ORM_
Entity
);
}
else
if
(
$hydrationMode
==
Doctrine
::
HYDRATE_SCALAR
)
{
//...
}
...
...
tests/Orm/UnitOfWorkTest.php
View file @
18ec38ee
...
...
@@ -85,7 +85,7 @@ class Orm_UnitOfWorkTest extends Doctrine_OrmTestCase
public
function
testRegisterDirty
()
{
$this
->
assertEquals
(
Doctrine_Entity
::
STATE_NEW
,
$this
->
_user
->
_state
());
$this
->
assertEquals
(
Doctrine_
ORM_
Entity
::
STATE_NEW
,
$this
->
_user
->
_state
());
$this
->
assertFalse
(
$this
->
_unitOfWork
->
isInIdentityMap
(
$this
->
_user
));
$this
->
_unitOfWork
->
registerDirty
(
$this
->
_user
);
$this
->
assertTrue
(
$this
->
_unitOfWork
->
isRegisteredDirty
(
$this
->
_user
));
...
...
@@ -105,7 +105,7 @@ class Orm_UnitOfWorkTest extends Doctrine_OrmTestCase
public
function
testSavingSingleEntityWithIdentityColumnForcesInsert
()
{
$this
->
assertEquals
(
Doctrine_Entity
::
STATE_NEW
,
$this
->
_user
->
_state
());
$this
->
assertEquals
(
Doctrine_
ORM_
Entity
::
STATE_NEW
,
$this
->
_user
->
_state
());
$this
->
_unitOfWork
->
save
(
$this
->
_user
);
...
...
@@ -114,7 +114,7 @@ class Orm_UnitOfWorkTest extends Doctrine_OrmTestCase
$this
->
assertEquals
(
0
,
count
(
$this
->
_persisterMock
->
getDeletes
()));
$this
->
assertTrue
(
$this
->
_unitOfWork
->
isInIdentityMap
(
$this
->
_user
));
$this
->
assertEquals
(
Doctrine_Entity
::
STATE_MANAGED
,
$this
->
_user
->
_state
());
$this
->
assertEquals
(
Doctrine_
ORM_
Entity
::
STATE_MANAGED
,
$this
->
_user
->
_state
());
// should no longer be scheduled for insert
$this
->
assertFalse
(
$this
->
_unitOfWork
->
isRegisteredNew
(
$this
->
_user
));
...
...
tests/lib/mocks/Doctrine_EntityPersisterMock.php
View file @
18ec38ee
...
...
@@ -8,7 +8,7 @@ class Doctrine_EntityPersisterMock extends Doctrine_ORM_Persisters_StandardEntit
private
$_identityColumnValueCounter
=
0
;
public
function
insert
(
Doctrine_Entity
$entity
)
public
function
insert
(
Doctrine_
ORM_
Entity
$entity
)
{
if
(
$entity
->
getClass
()
->
isIdGeneratorIdentity
())
{
$entity
->
_assignIdentifier
(
$this
->
_identityColumnValueCounter
++
);
...
...
@@ -18,12 +18,12 @@ class Doctrine_EntityPersisterMock extends Doctrine_ORM_Persisters_StandardEntit
$this
->
_inserts
[]
=
$entity
;
}
public
function
update
(
Doctrine_Entity
$entity
)
public
function
update
(
Doctrine_
ORM_
Entity
$entity
)
{
$this
->
_updates
[]
=
$entity
;
}
public
function
delete
(
Doctrine_Entity
$entity
)
public
function
delete
(
Doctrine_
ORM_
Entity
$entity
)
{
$this
->
_deletes
[]
=
$entity
;
}
...
...
tests/lib/mocks/Doctrine_SequenceMock.php
View file @
18ec38ee
...
...
@@ -10,7 +10,7 @@ class Doctrine_SequenceMock extends Doctrine_ORM_Id_SequenceGenerator
* @param Doctrine_Entity $entity
* @override
*/
public
function
generate
(
Doctrine_Entity
$entity
)
public
function
generate
(
Doctrine_
ORM_
Entity
$entity
)
{
return
$this
->
_sequenceNumber
++
;
}
...
...
tests/models/cms/CmsArticle.php
View file @
18ec38ee
...
...
@@ -4,7 +4,7 @@
#use Doctrine::ORM::Entity;
class
CmsArticle
extends
Doctrine_Entity
class
CmsArticle
extends
Doctrine_
ORM_
Entity
{
#protected $id;
#protected $topic;
...
...
tests/models/cms/CmsComment.php
View file @
18ec38ee
...
...
@@ -4,7 +4,7 @@
#use Doctrine::ORM::Entity;
class
CmsComment
extends
Doctrine_Entity
class
CmsComment
extends
Doctrine_
ORM_
Entity
{
#protected $id;
#protected $topic;
...
...
tests/models/cms/CmsPhonenumber.php
View file @
18ec38ee
<?php
class
CmsPhonenumber
extends
Doctrine_Entity
class
CmsPhonenumber
extends
Doctrine_
ORM_
Entity
{
#protected $user_id;
#protected $phonenumber;
...
...
tests/models/cms/CmsUser.php
View file @
18ec38ee
...
...
@@ -4,7 +4,7 @@
#use Doctrine::ORM::Entity;
class
CmsUser
extends
Doctrine_Entity
class
CmsUser
extends
Doctrine_
ORM_
Entity
{
#protected $id;
#protected $status;
...
...
tests/models/company/CompanyEmployee.php
View file @
18ec38ee
<?php
class
CompanyEmployee
extends
Doctrine_Entity
class
CompanyEmployee
extends
Doctrine_
ORM_
Entity
{
#protected $id;
#protected $salary;
...
...
tests/models/forum/ForumAvatar.php
View file @
18ec38ee
<?php
class
ForumAvatar
extends
Doctrine_Entity
class
ForumAvatar
extends
Doctrine_
ORM_
Entity
{
public
static
function
initMetadata
(
$mapping
)
...
...
tests/models/forum/ForumBoard.php
View file @
18ec38ee
<?php
class
ForumBoard
extends
Doctrine_Entity
class
ForumBoard
extends
Doctrine_
ORM_
Entity
{
public
static
function
initMetadata
(
$mapping
)
{
...
...
tests/models/forum/ForumCategory.php
View file @
18ec38ee
<?php
class
ForumCategory
extends
Doctrine_Entity
class
ForumCategory
extends
Doctrine_
ORM_
Entity
{
public
static
function
initMetadata
(
$mapping
)
...
...
tests/models/forum/ForumEntry.php
View file @
18ec38ee
...
...
@@ -4,7 +4,7 @@
#use Doctrine::ORM::Entity;
class
ForumEntry
extends
Doctrine_Entity
class
ForumEntry
extends
Doctrine_
ORM_
Entity
{
#protected $id;
#protected $topic;
...
...
tests/models/forum/ForumUser.php
View file @
18ec38ee
...
...
@@ -4,7 +4,7 @@
#use Doctrine::ORM::Entity;
class
ForumUser
extends
Doctrine_Entity
class
ForumUser
extends
Doctrine_
ORM_
Entity
{
#protected $id;
#protected $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