Commit 18ec38ee authored by romanb's avatar romanb

moved Entity

parent 9c11c36b
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* *
* @since 2.0 * @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. * Saves the current state of the entity into the database.
...@@ -90,7 +90,7 @@ class Doctrine_ActiveEntity extends Doctrine_Entity ...@@ -90,7 +90,7 @@ class Doctrine_ActiveEntity extends Doctrine_Entity
// [FIX] Prevent mapped Doctrine_Entitys from being displayed fully // [FIX] Prevent mapped Doctrine_Entitys from being displayed fully
foreach ($this->_values as $key => $value) { foreach ($this->_values as $key => $value) {
if ($value instanceof Doctrine_Entity) { if ($value instanceof Doctrine_ORM_Entity) {
$a[$key] = $value->toArray($deep, $prefixKey); $a[$key] = $value->toArray($deep, $prefixKey);
} else { } else {
$a[$key] = $value; $a[$key] = $value;
...@@ -434,7 +434,7 @@ class Doctrine_ActiveEntity extends Doctrine_Entity ...@@ -434,7 +434,7 @@ class Doctrine_ActiveEntity extends Doctrine_Entity
$this->_extractIdentifier(); $this->_extractIdentifier();
$this->_state = Doctrine_Entity::STATE_CLEAN; $this->_state = Doctrine_ORM_Entity::STATE_CLEAN;
return $this; return $this;
} }
......
...@@ -1708,7 +1708,7 @@ class Doctrine_ClassMetadata implements Doctrine_Configurable, Serializable ...@@ -1708,7 +1708,7 @@ class Doctrine_ClassMetadata implements Doctrine_Configurable, Serializable
* @param string $event The lifecycle event. * @param string $event The lifecycle event.
* @param Entity $entity The Entity on which the event occured. * @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) { foreach ($this->getLifecycleCallbacks($lifecycleEvent) as $callback) {
$entity->$callback(); $entity->$callback();
......
...@@ -86,7 +86,7 @@ class Doctrine_ClassMetadata_Factory ...@@ -86,7 +86,7 @@ class Doctrine_ClassMetadata_Factory
$parentClasses = array(); $parentClasses = array();
$loadedParentClass = false; $loadedParentClass = false;
while ($parentClass = get_parent_class($parentClass)) { while ($parentClass = get_parent_class($parentClass)) {
if ($parentClass == 'Doctrine_Entity') { if ($parentClass == 'Doctrine_ORM_Entity') {
break; break;
} }
if (isset($classes[$parentClass])) { if (isset($classes[$parentClass])) {
...@@ -177,7 +177,7 @@ class Doctrine_ClassMetadata_Factory ...@@ -177,7 +177,7 @@ class Doctrine_ClassMetadata_Factory
// get parent classes // get parent classes
//TODO: Skip Entity types MappedSuperclass/Transient //TODO: Skip Entity types MappedSuperclass/Transient
do { do {
if ($className === 'Doctrine_Entity') { if ($className === 'Doctrine_ORM_Entity') {
break; break;
} else if ($className == $name) { } else if ($className == $name) {
continue; continue;
......
...@@ -229,7 +229,7 @@ class Doctrine_Collection implements Countable, IteratorAggregate, Serializable, ...@@ -229,7 +229,7 @@ class Doctrine_Collection implements Countable, IteratorAggregate, Serializable,
* *
* @return void * @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->_owner = $entity;
$this->_association = $relation; $this->_association = $relation;
...@@ -392,7 +392,7 @@ class Doctrine_Collection implements Countable, IteratorAggregate, Serializable, ...@@ -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); return array_search($record, $this->_data, true);
} }
...@@ -457,7 +457,7 @@ class Doctrine_Collection implements Countable, IteratorAggregate, Serializable, ...@@ -457,7 +457,7 @@ class Doctrine_Collection implements Countable, IteratorAggregate, Serializable,
*/ */
public function set($key, $value) 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'); throw new Doctrine_Collection_Exception('Value variable in set is not an instance of Doctrine_Entity');
} }
$this->_data[$key] = $value; $this->_data[$key] = $value;
...@@ -475,7 +475,7 @@ class Doctrine_Collection implements Countable, IteratorAggregate, Serializable, ...@@ -475,7 +475,7 @@ class Doctrine_Collection implements Countable, IteratorAggregate, Serializable,
public function add($value, $key = null) public function add($value, $key = null)
{ {
//TODO: really only allow entities? //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.'); throw new Doctrine_Record_Exception('Value variable in collection is not an instance of Doctrine_Entity.');
} }
......
...@@ -303,7 +303,7 @@ class Doctrine_Connection_UnitOfWork ...@@ -303,7 +303,7 @@ class Doctrine_Connection_UnitOfWork
* *
* @todo Rename to scheduleForInsert(). * @todo Rename to scheduleForInsert().
*/ */
public function registerNew(Doctrine_Entity $entity) public function registerNew(Doctrine_ORM_Entity $entity)
{ {
$oid = $entity->getOid(); $oid = $entity->getOid();
...@@ -329,11 +329,11 @@ class Doctrine_Connection_UnitOfWork ...@@ -329,11 +329,11 @@ class Doctrine_Connection_UnitOfWork
/** /**
* Checks whether an entity is registered as new on the unit of work. * Checks whether an entity is registered as new on the unit of work.
* *
* @param Doctrine_Entity $entity * @param Doctrine_ORM_Entity $entity
* @return boolean * @return boolean
* @todo Rename to isScheduledForInsert(). * @todo Rename to isScheduledForInsert().
*/ */
public function isRegisteredNew(Doctrine_Entity $entity) public function isRegisteredNew(Doctrine_ORM_Entity $entity)
{ {
return isset($this->_newEntities[$entity->getOid()]); return isset($this->_newEntities[$entity->getOid()]);
} }
...@@ -344,7 +344,7 @@ class Doctrine_Connection_UnitOfWork ...@@ -344,7 +344,7 @@ class Doctrine_Connection_UnitOfWork
* *
* @param Doctrine::ORM::Entity $entity * @param Doctrine::ORM::Entity $entity
*/ */
public function registerClean(Doctrine_Entity $entity) public function registerClean(Doctrine_ORM_Entity $entity)
{ {
$this->addToIdentityMap($entity); $this->addToIdentityMap($entity);
} }
...@@ -355,7 +355,7 @@ class Doctrine_Connection_UnitOfWork ...@@ -355,7 +355,7 @@ class Doctrine_Connection_UnitOfWork
* @param Doctrine::ORM::Entity $entity * @param Doctrine::ORM::Entity $entity
* @todo Rename to scheduleForUpdate(). * @todo Rename to scheduleForUpdate().
*/ */
public function registerDirty(Doctrine_Entity $entity) public function registerDirty(Doctrine_ORM_Entity $entity)
{ {
$oid = $entity->getOid(); $oid = $entity->getOid();
if ( ! $entity->_identifier()) { if ( ! $entity->_identifier()) {
...@@ -380,7 +380,7 @@ class Doctrine_Connection_UnitOfWork ...@@ -380,7 +380,7 @@ class Doctrine_Connection_UnitOfWork
* @return boolean * @return boolean
* @todo Rename to isScheduledForUpdate(). * @todo Rename to isScheduledForUpdate().
*/ */
public function isRegisteredDirty(Doctrine_Entity $entity) public function isRegisteredDirty(Doctrine_ORM_Entity $entity)
{ {
return isset($this->_dirtyEntities[$entity->getOid()]); return isset($this->_dirtyEntities[$entity->getOid()]);
} }
...@@ -390,7 +390,7 @@ class Doctrine_Connection_UnitOfWork ...@@ -390,7 +390,7 @@ class Doctrine_Connection_UnitOfWork
* *
* @todo Rename to scheduleForDelete(). * @todo Rename to scheduleForDelete().
*/ */
public function registerDeleted(Doctrine_Entity $entity) public function registerDeleted(Doctrine_ORM_Entity $entity)
{ {
$oid = $entity->getOid(); $oid = $entity->getOid();
if ( ! $this->isInIdentityMap($entity)) { if ( ! $this->isInIdentityMap($entity)) {
...@@ -420,7 +420,7 @@ class Doctrine_Connection_UnitOfWork ...@@ -420,7 +420,7 @@ class Doctrine_Connection_UnitOfWork
* @return boolean * @return boolean
* @todo Rename to isScheduledForDelete(). * @todo Rename to isScheduledForDelete().
*/ */
public function isRegisteredRemoved(Doctrine_Entity $entity) public function isRegisteredRemoved(Doctrine_ORM_Entity $entity)
{ {
return isset($this->_deletedEntities[$entity->getOid()]); return isset($this->_deletedEntities[$entity->getOid()]);
} }
...@@ -432,7 +432,7 @@ class Doctrine_Connection_UnitOfWork ...@@ -432,7 +432,7 @@ class Doctrine_Connection_UnitOfWork
* @param integer $oid object identifier * @param integer $oid object identifier
* @return boolean whether ot not the operation was successful * @return boolean whether ot not the operation was successful
*/ */
public function detach(Doctrine_Entity $entity) public function detach(Doctrine_ORM_Entity $entity)
{ {
if ($this->isInIdentityMap($entity)) { if ($this->isInIdentityMap($entity)) {
$this->removeFromIdentityMap($entity); $this->removeFromIdentityMap($entity);
...@@ -442,11 +442,11 @@ class Doctrine_Connection_UnitOfWork ...@@ -442,11 +442,11 @@ class Doctrine_Connection_UnitOfWork
/** /**
* Enter description here... * Enter description here...
* *
* @param Doctrine_Entity $entity * @param Doctrine_ORM_Entity $entity
* @return unknown * @return unknown
* @todo Rename to isScheduled() * @todo Rename to isScheduled()
*/ */
public function isEntityRegistered(Doctrine_Entity $entity) public function isEntityRegistered(Doctrine_ORM_Entity $entity)
{ {
$oid = $entity->getOid(); $oid = $entity->getOid();
return isset($this->_newEntities[$oid]) || return isset($this->_newEntities[$oid]) ||
...@@ -488,7 +488,7 @@ class Doctrine_Connection_UnitOfWork ...@@ -488,7 +488,7 @@ class Doctrine_Connection_UnitOfWork
* @return boolean TRUE if the registration was successful, FALSE if the identity of * @return boolean TRUE if the registration was successful, FALSE if the identity of
* the entity in question is already managed. * the entity in question is already managed.
*/ */
public function addToIdentityMap(Doctrine_Entity $entity) public function addToIdentityMap(Doctrine_ORM_Entity $entity)
{ {
$idHash = $this->getIdentifierHash($entity->_identifier()); $idHash = $this->getIdentifierHash($entity->_identifier());
if ($idHash === '') { if ($idHash === '') {
...@@ -500,17 +500,17 @@ class Doctrine_Connection_UnitOfWork ...@@ -500,17 +500,17 @@ class Doctrine_Connection_UnitOfWork
return false; return false;
} }
$this->_identityMap[$className][$idHash] = $entity; $this->_identityMap[$className][$idHash] = $entity;
$entity->_state(Doctrine_Entity::STATE_MANAGED); $entity->_state(Doctrine_ORM_Entity::STATE_MANAGED);
return true; return true;
} }
/** /**
* Removes an entity from the identity map. * Removes an entity from the identity map.
* *
* @param Doctrine_Entity $entity * @param Doctrine_ORM_Entity $entity
* @return unknown * @return unknown
*/ */
public function removeFromIdentityMap(Doctrine_Entity $entity) public function removeFromIdentityMap(Doctrine_ORM_Entity $entity)
{ {
$idHash = $this->getIdentifierHash($entity->_identifier()); $idHash = $this->getIdentifierHash($entity->_identifier());
if ($idHash === '') { if ($idHash === '') {
...@@ -565,10 +565,10 @@ class Doctrine_Connection_UnitOfWork ...@@ -565,10 +565,10 @@ class Doctrine_Connection_UnitOfWork
* Checks whether an entity is registered in the identity map of the * Checks whether an entity is registered in the identity map of the
* UnitOfWork. * UnitOfWork.
* *
* @param Doctrine_Entity $entity * @param Doctrine_ORM_Entity $entity
* @return boolean * @return boolean
*/ */
public function isInIdentityMap(Doctrine_Entity $entity) public function isInIdentityMap(Doctrine_ORM_Entity $entity)
{ {
$idHash = $this->getIdentifierHash($entity->_identifier()); $idHash = $this->getIdentifierHash($entity->_identifier());
if ($idHash === '') { if ($idHash === '') {
...@@ -596,9 +596,9 @@ class Doctrine_Connection_UnitOfWork ...@@ -596,9 +596,9 @@ class Doctrine_Connection_UnitOfWork
/** /**
* Saves an entity as part of the current unit of work. * Saves an entity as part of the current unit of work.
* *
* @param Doctrine_Entity $entity The entity to save. * @param Doctrine_ORM_Entity $entity The entity to save.
*/ */
public function save(Doctrine_Entity $entity) public function save(Doctrine_ORM_Entity $entity)
{ {
$insertNow = array(); $insertNow = array();
$visited = array(); $visited = array();
...@@ -620,10 +620,10 @@ class Doctrine_Connection_UnitOfWork ...@@ -620,10 +620,10 @@ class Doctrine_Connection_UnitOfWork
* This method is internally called during save() cascades as it tracks * This method is internally called during save() cascades as it tracks
* the already visited entities to prevent infinite recursions. * the already visited entities to prevent infinite recursions.
* *
* @param Doctrine_Entity $entity The entity to save. * @param Doctrine_ORM_Entity $entity The entity to save.
* @param array $visited The already visited entities. * @param array $visited The already visited entities.
*/ */
private function _doSave(Doctrine_Entity $entity, array &$visited, array &$insertNow) private function _doSave(Doctrine_ORM_Entity $entity, array &$visited, array &$insertNow)
{ {
if (isset($visited[$entity->getOid()])) { if (isset($visited[$entity->getOid()])) {
return; // Prevent infinite recursion return; // Prevent infinite recursion
...@@ -633,10 +633,10 @@ class Doctrine_Connection_UnitOfWork ...@@ -633,10 +633,10 @@ class Doctrine_Connection_UnitOfWork
$class = $entity->getClass(); $class = $entity->getClass();
switch ($entity->_state()) { switch ($entity->_state()) {
case Doctrine_Entity::STATE_MANAGED: case Doctrine_ORM_Entity::STATE_MANAGED:
// nothing to do for $entity // nothing to do for $entity
break; break;
case Doctrine_Entity::STATE_NEW: case Doctrine_ORM_Entity::STATE_NEW:
$result = $class->getIdGenerator()->generate($entity); $result = $class->getIdGenerator()->generate($entity);
if ($result == Doctrine_ORM_Id_AbstractIdGenerator::POST_INSERT_INDICATOR) { if ($result == Doctrine_ORM_Id_AbstractIdGenerator::POST_INSERT_INDICATOR) {
$insertNow[$entity->getOid()] = $entity; $insertNow[$entity->getOid()] = $entity;
...@@ -645,11 +645,11 @@ class Doctrine_Connection_UnitOfWork ...@@ -645,11 +645,11 @@ class Doctrine_Connection_UnitOfWork
} }
$this->registerNew($entity); $this->registerNew($entity);
break; break;
case Doctrine_Entity::STATE_DETACHED: case Doctrine_ORM_Entity::STATE_DETACHED:
//exception? //exception?
throw new Doctrine_Exception("Behavior of save() for a detached entity " throw new Doctrine_Exception("Behavior of save() for a detached entity "
. "is not yet defined."); . "is not yet defined.");
case Doctrine_Entity::STATE_DELETED: case Doctrine_ORM_Entity::STATE_DELETED:
// $entity becomes managed again // $entity becomes managed again
if ($this->isRegisteredRemoved($entity)) { if ($this->isRegisteredRemoved($entity)) {
//TODO: better a method for this? //TODO: better a method for this?
...@@ -670,9 +670,9 @@ class Doctrine_Connection_UnitOfWork ...@@ -670,9 +670,9 @@ class Doctrine_Connection_UnitOfWork
/** /**
* Deletes an entity as part of the current unit of work. * Deletes an entity as part of the current unit of work.
* *
* @param Doctrine_Entity $entity * @param Doctrine_ORM_Entity $entity
*/ */
public function delete(Doctrine_Entity $entity) public function delete(Doctrine_ORM_Entity $entity)
{ {
$this->_doDelete($entity, array()); $this->_doDelete($entity, array());
} }
...@@ -680,10 +680,10 @@ class Doctrine_Connection_UnitOfWork ...@@ -680,10 +680,10 @@ class Doctrine_Connection_UnitOfWork
/** /**
* Enter description here... * Enter description here...
* *
* @param Doctrine_Entity $entity * @param Doctrine_ORM_Entity $entity
* @param array $visited * @param array $visited
*/ */
private function _doDelete(Doctrine_Entity $entity, array &$visited) private function _doDelete(Doctrine_ORM_Entity $entity, array &$visited)
{ {
if (isset($visited[$entity->getOid()])) { if (isset($visited[$entity->getOid()])) {
return; // Prevent infinite recursion return; // Prevent infinite recursion
...@@ -693,14 +693,14 @@ class Doctrine_Connection_UnitOfWork ...@@ -693,14 +693,14 @@ class Doctrine_Connection_UnitOfWork
$class = $entity->getClass(); $class = $entity->getClass();
switch ($entity->_state()) { switch ($entity->_state()) {
case Doctrine_Entity::STATE_NEW: case Doctrine_ORM_Entity::STATE_NEW:
case Doctrine_Entity::STATE_DELETED: case Doctrine_ORM_Entity::STATE_DELETED:
// nothing to do for $entity // nothing to do for $entity
break; break;
case Doctrine_Entity::STATE_MANAGED: case Doctrine_ORM_Entity::STATE_MANAGED:
$this->registerDeleted($entity); $this->registerDeleted($entity);
break; break;
case Doctrine_Entity::STATE_DETACHED: case Doctrine_ORM_Entity::STATE_DETACHED:
//exception? //exception?
throw new Doctrine_Exception("A detached entity can't be deleted."); throw new Doctrine_Exception("A detached entity can't be deleted.");
default: default:
...@@ -714,17 +714,17 @@ class Doctrine_Connection_UnitOfWork ...@@ -714,17 +714,17 @@ class Doctrine_Connection_UnitOfWork
/** /**
* Cascades the save operation to associated entities. * Cascades the save operation to associated entities.
* *
* @param Doctrine_Entity $entity * @param Doctrine_ORM_Entity $entity
* @param array $visited * @param array $visited
*/ */
private function _cascadeSave(Doctrine_Entity $entity, array &$visited, array &$insertNow) private function _cascadeSave(Doctrine_ORM_Entity $entity, array &$visited, array &$insertNow)
{ {
foreach ($entity->getClass()->getAssociationMappings() as $assocMapping) { foreach ($entity->getClass()->getAssociationMappings() as $assocMapping) {
if ( ! $assocMapping->isCascadeSave()) { if ( ! $assocMapping->isCascadeSave()) {
continue; continue;
} }
$relatedEntities = $entity->get($assocMapping->getSourceFieldName()); $relatedEntities = $entity->get($assocMapping->getSourceFieldName());
if ($relatedEntities instanceof Doctrine_Entity) { if ($relatedEntities instanceof Doctrine_ORM_Entity) {
$this->_doSave($relatedEntities, $visited, $insertNow); $this->_doSave($relatedEntities, $visited, $insertNow);
} else if ($relatedEntities instanceof Doctrine_Collection && } else if ($relatedEntities instanceof Doctrine_Collection &&
count($relatedEntities) > 0) { count($relatedEntities) > 0) {
...@@ -735,7 +735,7 @@ class Doctrine_Connection_UnitOfWork ...@@ -735,7 +735,7 @@ class Doctrine_Connection_UnitOfWork
} }
} }
private function _cascadeDelete(Doctrine_Entity $entity) private function _cascadeDelete(Doctrine_ORM_Entity $entity)
{ {
} }
......
...@@ -280,7 +280,7 @@ class Doctrine_EntityManager ...@@ -280,7 +280,7 @@ class Doctrine_EntityManager
* @param Doctrine_Entity $entity * @param Doctrine_Entity $entity
* @return unknown * @return unknown
*/ */
public function detach(Doctrine_Entity $entity) public function detach(Doctrine_ORM_Entity $entity)
{ {
return $this->_unitOfWork->removeFromIdentityMap($entity); return $this->_unitOfWork->removeFromIdentityMap($entity);
} }
...@@ -431,7 +431,7 @@ class Doctrine_EntityManager ...@@ -431,7 +431,7 @@ class Doctrine_EntityManager
* @param Doctrine::ORM::Entity $entity * @param Doctrine::ORM::Entity $entity
* @return void * @return void
*/ */
public function save(Doctrine_Entity $entity) public function save(Doctrine_ORM_Entity $entity)
{ {
$this->_errorIfNotActiveOrClosed(); $this->_errorIfNotActiveOrClosed();
$this->_unitOfWork->save($entity); $this->_unitOfWork->save($entity);
...@@ -446,7 +446,7 @@ class Doctrine_EntityManager ...@@ -446,7 +446,7 @@ class Doctrine_EntityManager
* @param Doctrine::ORM::Entity $entity * @param Doctrine::ORM::Entity $entity
* @return void * @return void
*/ */
public function delete(Doctrine_Entity $entity) public function delete(Doctrine_ORM_Entity $entity)
{ {
$this->_errorIfNotActiveOrClosed(); $this->_errorIfNotActiveOrClosed();
$this->_unitOfWork->delete($entity); $this->_unitOfWork->delete($entity);
...@@ -463,7 +463,7 @@ class Doctrine_EntityManager ...@@ -463,7 +463,7 @@ class Doctrine_EntityManager
* @return void * @return void
* @todo FIX Impl * @todo FIX Impl
*/ */
public function refresh(Doctrine_Entity $entity) public function refresh(Doctrine_ORM_Entity $entity)
{ {
$this->_mergeData($entity, $entity->getRepository()->find( $this->_mergeData($entity, $entity->getRepository()->find(
$entity->identifier(), Doctrine_Query::HYDRATE_ARRAY), $entity->identifier(), Doctrine_Query::HYDRATE_ARRAY),
...@@ -476,7 +476,7 @@ class Doctrine_EntityManager ...@@ -476,7 +476,7 @@ class Doctrine_EntityManager
* @param Doctrine::ORM::Entity $entity The entity to copy. * @param Doctrine::ORM::Entity $entity The entity to copy.
* @return Doctrine::ORM::Entity The new entity. * @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 ...@@ -560,7 +560,7 @@ class Doctrine_EntityManager
* @param boolean $overrideLocalChanges * @param boolean $overrideLocalChanges
* @return void * @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) { if ($overrideLocalChanges) {
foreach ($data as $field => $value) { foreach ($data as $field => $value) {
$entity->_internalSetField($field, $value); $entity->_internalSetField($field, $value);
...@@ -582,7 +582,7 @@ class Doctrine_EntityManager ...@@ -582,7 +582,7 @@ class Doctrine_EntityManager
* @return boolean TRUE if this EntityManager currently manages the given entity * @return boolean TRUE if this EntityManager currently manages the given entity
* (and has it in the identity map), FALSE otherwise. * (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) && return $this->_unitOfWork->isInIdentityMap($entity) &&
! $this->_unitOfWork->isRegisteredRemoved($entity); ! $this->_unitOfWork->isRegisteredRemoved($entity);
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
* @since 2.0 * @since 2.0
* @version $Revision: 4342 $ * @version $Revision: 4342 $
*/ */
abstract class Doctrine_Entity implements ArrayAccess, Serializable abstract class Doctrine_ORM_Entity implements ArrayAccess, Serializable
{ {
/** /**
* MANAGED * MANAGED
...@@ -276,7 +276,7 @@ abstract class Doctrine_Entity implements ArrayAccess, Serializable ...@@ -276,7 +276,7 @@ abstract class Doctrine_Entity implements ArrayAccess, Serializable
$this->_data = array_merge($this->_data, $this->_id); $this->_data = array_merge($this->_data, $this->_id);
foreach ($this->_data as $k => $v) { 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]); unset($vars['_data'][$k]);
} else if ($v === Doctrine_Null::$INSTANCE) { } else if ($v === Doctrine_Null::$INSTANCE) {
unset($vars['_data'][$k]); unset($vars['_data'][$k]);
...@@ -541,7 +541,7 @@ abstract class Doctrine_Entity implements ArrayAccess, Serializable ...@@ -541,7 +541,7 @@ abstract class Doctrine_Entity implements ArrayAccess, Serializable
$rel = $this->_class->getAssociationMapping($name); $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(); throw Doctrine_Entity_Exception::invalidValueForOneToOneReference();
} else if (($rel->isOneToMany() || $rel->isManyToMany()) && ! $value instanceof Doctrine_Collection) { } else if (($rel->isOneToMany() || $rel->isManyToMany()) && ! $value instanceof Doctrine_Collection) {
throw Doctrine_Entity_Exception::invalidValueForOneToManyReference(); throw Doctrine_Entity_Exception::invalidValueForOneToManyReference();
......
...@@ -52,7 +52,7 @@ class Doctrine_Export_Schema ...@@ -52,7 +52,7 @@ class Doctrine_Export_Schema
$array = array(); $array = array();
$parent = new ReflectionClass('Doctrine_Entity'); $parent = new ReflectionClass('Doctrine_ORM_Entity');
$sql = array(); $sql = array();
$fks = array(); $fks = array();
......
...@@ -18,7 +18,7 @@ abstract class Doctrine_ORM_Id_AbstractIdGenerator ...@@ -18,7 +18,7 @@ abstract class Doctrine_ORM_Id_AbstractIdGenerator
$this->_em = $em; $this->_em = $em;
} }
abstract public function generate(Doctrine_Entity $entity); abstract public function generate(Doctrine_ORM_Entity $entity);
} }
?> ?>
\ No newline at end of file
...@@ -10,11 +10,11 @@ class Doctrine_ORM_Id_Assigned extends Doctrine_ORM_Id_AbstractIdGenerator ...@@ -10,11 +10,11 @@ class Doctrine_ORM_Id_Assigned extends Doctrine_ORM_Id_AbstractIdGenerator
/** /**
* Enter description here... * Enter description here...
* *
* @param Doctrine_Entity $entity * @param Doctrine_ORM_Entity $entity
* @return unknown * @return unknown
* @override * @override
*/ */
public function generate(Doctrine_Entity $entity) public function generate(Doctrine_ORM_Entity $entity)
{ {
if ( ! $entity->_identifier()) { if ( ! $entity->_identifier()) {
throw Doctrine_IdException::missingAssignedId($entity); throw Doctrine_IdException::missingAssignedId($entity);
......
...@@ -5,11 +5,11 @@ class Doctrine_ORM_Id_IdentityGenerator extends Doctrine_ORM_Id_AbstractIdGenera ...@@ -5,11 +5,11 @@ class Doctrine_ORM_Id_IdentityGenerator extends Doctrine_ORM_Id_AbstractIdGenera
/** /**
* Enter description here... * Enter description here...
* *
* @param Doctrine_Entity $entity * @param Doctrine_ORM_Entity $entity
* @return unknown * @return unknown
* @override * @override
*/ */
public function generate(Doctrine_Entity $entity) public function generate(Doctrine_ORM_Entity $entity)
{ {
return self::POST_INSERT_INDICATOR; return self::POST_INSERT_INDICATOR;
} }
......
...@@ -12,10 +12,10 @@ class Doctrine_ORM_Id_SequenceGenerator extends Doctrine_ORM_Id_AbstractIdGenera ...@@ -12,10 +12,10 @@ class Doctrine_ORM_Id_SequenceGenerator extends Doctrine_ORM_Id_AbstractIdGenera
/** /**
* Enter description here... * Enter description here...
* *
* @param Doctrine_Entity $entity * @param Doctrine_ORM_Entity $entity
* @override * @override
*/ */
public function generate(Doctrine_Entity $entity) public function generate(Doctrine_ORM_Entity $entity)
{ {
$conn = $this->_em->getConnection(); $conn = $this->_em->getConnection();
$sql = $conn->getDatabasePlatform()->getSequenceNextValSql($this->_sequenceName); $sql = $conn->getDatabasePlatform()->getSequenceNextValSql($this->_sequenceName);
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
class Doctrine_ORM_Id_TableGenerator extends Doctrine_ORM_Id_AbstractIdGenerator 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"); throw new Exception("Not implemented");
} }
......
...@@ -44,7 +44,7 @@ class Doctrine_Import_Schema ...@@ -44,7 +44,7 @@ class Doctrine_Import_Schema
'packagesPath' => '', 'packagesPath' => '',
'generateBaseClasses' => true, 'generateBaseClasses' => true,
'baseClassesDirectory' => 'generated', 'baseClassesDirectory' => 'generated',
'baseClassName' => 'Doctrine_Entity', 'baseClassName' => 'Doctrine_ORM_Entity',
'suffix' => '.php'); 'suffix' => '.php');
/** /**
......
...@@ -67,7 +67,7 @@ class Doctrine_ORM_Internal_Hydration_ObjectDriver ...@@ -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])) { if ( ! isset($this->_initializedRelations[$entity->getOid()][$name])) {
$relation = $entity->getClass()->getAssociationMapping($name); $relation = $entity->getClass()->getAssociationMapping($name);
...@@ -95,39 +95,39 @@ class Doctrine_ORM_Internal_Hydration_ObjectDriver ...@@ -95,39 +95,39 @@ class Doctrine_ORM_Internal_Hydration_ObjectDriver
return $this->_em->createEntity($className, $data); return $this->_em->createEntity($className, $data);
} }
public function addRelatedIndexedElement(Doctrine_Entity $entity1, $property, public function addRelatedIndexedElement(Doctrine_ORM_Entity $entity1, $property,
Doctrine_Entity $entity2, $indexField) Doctrine_ORM_Entity $entity2, $indexField)
{ {
$entity1->_internalGetReference($property)->add($entity2, $entity2->_internalGetField($indexField)); $entity1->_internalGetReference($property)->add($entity2, $entity2->_internalGetField($indexField));
} }
public function addRelatedElement(Doctrine_Entity $entity1, $property, public function addRelatedElement(Doctrine_ORM_Entity $entity1, $property,
Doctrine_Entity $entity2) Doctrine_ORM_Entity $entity2)
{ {
$entity1->_internalGetReference($property)->add($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); $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); 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); return $entity->contains($field);
} }
public function getFieldValue(Doctrine_Entity $entity, $field) public function getFieldValue(Doctrine_ORM_Entity $entity, $field)
{ {
return $entity->_internalGetField($field); return $entity->_internalGetField($field);
} }
public function getReferenceValue(Doctrine_Entity $entity, $field) public function getReferenceValue(Doctrine_ORM_Entity $entity, $field)
{ {
return $entity->_internalGetReference($field); return $entity->_internalGetReference($field);
} }
......
...@@ -317,7 +317,7 @@ class Doctrine_ORM_Internal_Hydration_StandardHydrator extends Doctrine_ORM_Inte ...@@ -317,7 +317,7 @@ class Doctrine_ORM_Internal_Hydration_StandardHydrator extends Doctrine_ORM_Inte
end($coll); end($coll);
$resultPointers[$dqlAlias] =& $coll[key($coll)]; $resultPointers[$dqlAlias] =& $coll[key($coll)];
} }
} else if ($coll instanceof Doctrine_Entity) { } else if ($coll instanceof Doctrine_ORM_Entity) {
$resultPointers[$dqlAlias] = $coll; $resultPointers[$dqlAlias] = $coll;
} else if (count($coll) > 0) { } else if (count($coll) > 0) {
$resultPointers[$dqlAlias] = $coll->getLast(); $resultPointers[$dqlAlias] = $coll->getLast();
......
...@@ -133,7 +133,7 @@ class Doctrine_ORM_Mapping_OneToOneMapping extends Doctrine_ORM_Mapping_Associat ...@@ -133,7 +133,7 @@ class Doctrine_ORM_Mapping_OneToOneMapping extends Doctrine_ORM_Mapping_Associat
* @param Doctrine::ORM::Entity $entity * @param Doctrine::ORM::Entity $entity
* @return void * @return void
*/ */
public function lazyLoadFor(Doctrine_Entity $entity) public function lazyLoadFor(Doctrine_ORM_Entity $entity)
{ {
if ($entity->getClassName() != $this->_sourceClass->getClassName()) { if ($entity->getClassName() != $this->_sourceClass->getClassName()) {
//error? //error?
......
...@@ -89,7 +89,7 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister ...@@ -89,7 +89,7 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister
* @param Doctrine::ORM::Entity $entity The entity to insert. * @param Doctrine::ORM::Entity $entity The entity to insert.
* @return void * @return void
*/ */
public function insert(Doctrine_Entity $entity) public function insert(Doctrine_ORM_Entity $entity)
{ {
$insertData = array(); $insertData = array();
$class = $entity->getClass(); $class = $entity->getClass();
...@@ -149,7 +149,7 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister ...@@ -149,7 +149,7 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister
* @param Doctrine::ORM::Entity $entity The entity to update. * @param Doctrine::ORM::Entity $entity The entity to update.
* @return void * @return void
*/ */
public function update(Doctrine_Entity $entity) public function update(Doctrine_ORM_Entity $entity)
{ {
$dataChangeSet = $entity->_getDataChangeSet(); $dataChangeSet = $entity->_getDataChangeSet();
$referenceChangeSet = $entity->_getReferenceChangeSet(); $referenceChangeSet = $entity->_getReferenceChangeSet();
...@@ -175,7 +175,7 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister ...@@ -175,7 +175,7 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister
* @param Doctrine::ORM::Entity $entity The entity to delete. * @param Doctrine::ORM::Entity $entity The entity to delete.
* @return void * @return void
*/ */
public function delete(Doctrine_Entity $entity) public function delete(Doctrine_ORM_Entity $entity)
{ {
//TODO: perform delete //TODO: perform delete
} }
...@@ -334,14 +334,14 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister ...@@ -334,14 +334,14 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister
* @throws PDOException if something went wrong at database level * @throws PDOException if something went wrong at database level
* @return void * @return void
*/ */
protected function _deleteComposites(Doctrine_Entity $record) protected function _deleteComposites(Doctrine_ORM_Entity $record)
{ {
$classMetadata = $this->_classMetadata; $classMetadata = $this->_classMetadata;
foreach ($classMetadata->getRelations() as $fk) { foreach ($classMetadata->getRelations() as $fk) {
if ($fk->isComposite()) { if ($fk->isComposite()) {
$obj = $record->get($fk->getAlias()); $obj = $record->get($fk->getAlias());
if ($obj instanceof Doctrine_Entity && if ($obj instanceof Doctrine_ORM_Entity &&
$obj->_state() != Doctrine_Entity::STATE_LOCKED) { $obj->_state() != Doctrine_ORM_Entity::STATE_LOCKED) {
$obj->delete($this->_mapper->getConnection()); $obj->delete($this->_mapper->getConnection());
} }
} }
...@@ -381,7 +381,7 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister ...@@ -381,7 +381,7 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister
* @param Doctrine_Connection $conn The connection to use. Will default to the mapper's * @param Doctrine_Connection $conn The connection to use. Will default to the mapper's
* connection. * connection.
*/ */
public function save(Doctrine_Entity $record) public function save(Doctrine_ORM_Entity $record)
{ {
if ( ! ($record instanceof $this->_domainClassName)) { if ( ! ($record instanceof $this->_domainClassName)) {
throw new Doctrine_Mapper_Exception("Mapper of type " . $this->_domainClassName . " throw new Doctrine_Mapper_Exception("Mapper of type " . $this->_domainClassName . "
...@@ -393,11 +393,11 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister ...@@ -393,11 +393,11 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister
} }
$state = $record->_state(); $state = $record->_state();
if ($state === Doctrine_Entity::STATE_LOCKED) { if ($state === Doctrine_ORM_Entity::STATE_LOCKED) {
return false; return false;
} }
$record->_state(Doctrine_Entity::STATE_LOCKED); $record->_state(Doctrine_ORM_Entity::STATE_LOCKED);
try { try {
$conn->beginInternalTransaction(); $conn->beginInternalTransaction();
...@@ -412,7 +412,7 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister ...@@ -412,7 +412,7 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister
} }
$state = $record->_state(); $state = $record->_state();
$record->_state(Doctrine_Entity::STATE_LOCKED); $record->_state(Doctrine_ORM_Entity::STATE_LOCKED);
foreach ($saveLater as $fk) { foreach ($saveLater as $fk) {
$alias = $fk->getAlias(); $alias = $fk->getAlias();
...@@ -443,21 +443,21 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister ...@@ -443,21 +443,21 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister
* *
* @param Doctrine_Entity $record The entity to insert/update. * @param Doctrine_Entity $record The entity to insert/update.
*/ */
protected function _insertOrUpdate(Doctrine_Entity $record) protected function _insertOrUpdate(Doctrine_ORM_Entity $record)
{ {
//$record->preSave(); //$record->preSave();
//$this->notifyEntityListeners($record, 'preSave', Doctrine_Event::RECORD_SAVE); //$this->notifyEntityListeners($record, 'preSave', Doctrine_Event::RECORD_SAVE);
switch ($record->_state()) { switch ($record->_state()) {
case Doctrine_Entity::STATE_TDIRTY: case Doctrine_ORM_Entity::STATE_TDIRTY:
$this->_insert($record); $this->_insert($record);
break; break;
case Doctrine_Entity::STATE_DIRTY: case Doctrine_ORM_Entity::STATE_DIRTY:
case Doctrine_Entity::STATE_PROXY: case Doctrine_ORM_Entity::STATE_PROXY:
$this->_update($record); $this->_update($record);
break; break;
case Doctrine_Entity::STATE_CLEAN: case Doctrine_ORM_Entity::STATE_CLEAN:
case Doctrine_Entity::STATE_TCLEAN: case Doctrine_ORM_Entity::STATE_TCLEAN:
// do nothing // do nothing
break; break;
} }
...@@ -472,7 +472,7 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister ...@@ -472,7 +472,7 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister
* @param Doctrine_Entity $record * @param Doctrine_Entity $record
* @return void * @return void
*/ */
public function saveSingleRecord(Doctrine_Entity $record) public function saveSingleRecord(Doctrine_ORM_Entity $record)
{ {
$this->_insertOrUpdate($record); $this->_insertOrUpdate($record);
} }
...@@ -483,7 +483,7 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister ...@@ -483,7 +483,7 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister
* @throws PDOException if something went wrong at database level * @throws PDOException if something went wrong at database level
* @param Doctrine_Entity $record * @param Doctrine_Entity $record
*/ */
protected function _saveRelated(Doctrine_Entity $record) protected function _saveRelated(Doctrine_ORM_Entity $record)
{ {
$saveLater = array(); $saveLater = array();
foreach ($record->_getReferences() as $k => $v) { foreach ($record->_getReferences() as $k => $v) {
...@@ -499,7 +499,7 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister ...@@ -499,7 +499,7 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister
$obj = $record->get($rel->getAlias()); $obj = $record->get($rel->getAlias());
// Protection against infinite function recursion before attempting to save // 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(); $obj->save();
/** Can this be removed? /** Can this be removed?
...@@ -531,7 +531,7 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister ...@@ -531,7 +531,7 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister
* @param Doctrine_Entity $record * @param Doctrine_Entity $record
* @return void * @return void
*/ */
public function saveAssociations(Doctrine_Entity $record) public function saveAssociations(Doctrine_ORM_Entity $record)
{ {
foreach ($record->_getReferences() as $relationName => $relatedObject) { foreach ($record->_getReferences() as $relationName => $relatedObject) {
if ($relatedObject === Doctrine_Null::$INSTANCE) { if ($relatedObject === Doctrine_Null::$INSTANCE) {
...@@ -573,7 +573,7 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister ...@@ -573,7 +573,7 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister
* @return boolean whether or not the update was successful * @return boolean whether or not the update was successful
* @todo Move to Doctrine_Table (which will become Doctrine_Mapper). * @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(); $record->preUpdate();
$this->notifyEntityListeners($record, 'preUpdate', Doctrine_Event::RECORD_UPDATE); $this->notifyEntityListeners($record, 'preUpdate', Doctrine_Event::RECORD_UPDATE);
...@@ -587,7 +587,7 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister ...@@ -587,7 +587,7 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister
return true; return true;
} }
abstract protected function _doUpdate(Doctrine_Entity $entity); abstract protected function _doUpdate(Doctrine_ORM_Entity $entity);
/** /**
* Inserts an entity. * Inserts an entity.
...@@ -595,7 +595,7 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister ...@@ -595,7 +595,7 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister
* @param Doctrine_Entity $record record to be inserted * @param Doctrine_Entity $record record to be inserted
* @return boolean * @return boolean
*/ */
protected function _insert(Doctrine_Entity $record) protected function _insert(Doctrine_ORM_Entity $record)
{ {
$record->preInsert(); $record->preInsert();
$this->notifyEntityListeners($record, 'preInsert', Doctrine_Event::RECORD_INSERT); $this->notifyEntityListeners($record, 'preInsert', Doctrine_Event::RECORD_INSERT);
...@@ -609,7 +609,7 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister ...@@ -609,7 +609,7 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister
return true; 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. * Deletes given entity and all it's related entities.
...@@ -619,7 +619,7 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister ...@@ -619,7 +619,7 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister
* @return boolean true on success, false on failure * @return boolean true on success, false on failure
* @throws Doctrine_Mapper_Exception * @throws Doctrine_Mapper_Exception
*/ */
public function delete_old(Doctrine_Entity $record) public function delete_old(Doctrine_ORM_Entity $record)
{ {
if ( ! $record->exists()) { if ( ! $record->exists()) {
return false; return false;
...@@ -640,7 +640,7 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister ...@@ -640,7 +640,7 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister
$table = $this->_classMetadata; $table = $this->_classMetadata;
$state = $record->_state(); $state = $record->_state();
$record->_state(Doctrine_Entity::STATE_LOCKED); $record->_state(Doctrine_ORM_Entity::STATE_LOCKED);
$this->_doDelete($record); $this->_doDelete($record);
......
...@@ -38,7 +38,7 @@ class Doctrine_ORM_Persisters_JoinedSubclassPersister extends Doctrine_ORM_Persi ...@@ -38,7 +38,7 @@ class Doctrine_ORM_Persisters_JoinedSubclassPersister extends Doctrine_ORM_Persi
* @return boolean * @return boolean
* @override * @override
*/ */
public function insert(Doctrine_Entity $entity) public function insert(Doctrine_ORM_Entity $entity)
{ {
$class = $entity->getClass(); $class = $entity->getClass();
...@@ -88,7 +88,7 @@ class Doctrine_ORM_Persisters_JoinedSubclassPersister extends Doctrine_ORM_Persi ...@@ -88,7 +88,7 @@ class Doctrine_ORM_Persisters_JoinedSubclassPersister extends Doctrine_ORM_Persi
* @param Doctrine_Entity $record record to be updated * @param Doctrine_Entity $record record to be updated
* @return boolean whether or not the update was successful * @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; $conn = $this->_conn;
$classMetadata = $this->_classMetadata; $classMetadata = $this->_classMetadata;
...@@ -99,7 +99,7 @@ class Doctrine_ORM_Persisters_JoinedSubclassPersister extends Doctrine_ORM_Persi ...@@ -99,7 +99,7 @@ class Doctrine_ORM_Persisters_JoinedSubclassPersister extends Doctrine_ORM_Persi
array_unshift($classes, $component); array_unshift($classes, $component);
foreach ($record as $field => $value) { foreach ($record as $field => $value) {
if ($value instanceof Doctrine_Entity) { if ($value instanceof Doctrine_ORM_Entity) {
if ( ! $value->exists()) { if ( ! $value->exists()) {
$value->save(); $value->save();
} }
...@@ -122,7 +122,7 @@ class Doctrine_ORM_Persisters_JoinedSubclassPersister extends Doctrine_ORM_Persi ...@@ -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. * 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; $conn = $this->_conn;
try { try {
...@@ -130,7 +130,7 @@ class Doctrine_ORM_Persisters_JoinedSubclassPersister extends Doctrine_ORM_Persi ...@@ -130,7 +130,7 @@ class Doctrine_ORM_Persisters_JoinedSubclassPersister extends Doctrine_ORM_Persi
$conn->beginInternalTransaction(); $conn->beginInternalTransaction();
$this->_deleteComposites($record); $this->_deleteComposites($record);
$record->_state(Doctrine_Entity::STATE_TDIRTY); $record->_state(Doctrine_ORM_Entity::STATE_TDIRTY);
$identifier = $this->_convertFieldToColumnNames($record->identifier(), $class); $identifier = $this->_convertFieldToColumnNames($record->identifier(), $class);
...@@ -141,7 +141,7 @@ class Doctrine_ORM_Persisters_JoinedSubclassPersister extends Doctrine_ORM_Persi ...@@ -141,7 +141,7 @@ class Doctrine_ORM_Persisters_JoinedSubclassPersister extends Doctrine_ORM_Persi
$this->_deleteRow($parentClass->getTableName(), $identifier); $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 $this->removeRecord($record); // @todo should be done in the unitofwork
$conn->commit(); $conn->commit();
......
...@@ -34,7 +34,7 @@ class Doctrine_ORM_Persisters_StandardEntityPersister extends Doctrine_ORM_Persi ...@@ -34,7 +34,7 @@ class Doctrine_ORM_Persisters_StandardEntityPersister extends Doctrine_ORM_Persi
/** /**
* Deletes an entity. * Deletes an entity.
*/ */
protected function _doDelete(Doctrine_Entity $record) protected function _doDelete(Doctrine_ORM_Entity $record)
{ {
$conn = $this->_conn; $conn = $this->_conn;
$metadata = $this->_classMetadata; $metadata = $this->_classMetadata;
...@@ -42,11 +42,11 @@ class Doctrine_ORM_Persisters_StandardEntityPersister extends Doctrine_ORM_Persi ...@@ -42,11 +42,11 @@ class Doctrine_ORM_Persisters_StandardEntityPersister extends Doctrine_ORM_Persi
$conn->beginInternalTransaction(); $conn->beginInternalTransaction();
$this->_deleteComposites($record); $this->_deleteComposites($record);
$record->_state(Doctrine_Entity::STATE_TDIRTY); $record->_state(Doctrine_ORM_Entity::STATE_TDIRTY);
$identifier = $this->_convertFieldToColumnNames($record->identifier(), $metadata); $identifier = $this->_convertFieldToColumnNames($record->identifier(), $metadata);
$this->_deleteRow($metadata->getTableName(), $identifier); $this->_deleteRow($metadata->getTableName(), $identifier);
$record->_state(Doctrine_Entity::STATE_TCLEAN); $record->_state(Doctrine_ORM_Entity::STATE_TCLEAN);
$this->removeRecord($record); $this->removeRecord($record);
$conn->commit(); $conn->commit();
...@@ -61,7 +61,7 @@ class Doctrine_ORM_Persisters_StandardEntityPersister extends Doctrine_ORM_Persi ...@@ -61,7 +61,7 @@ class Doctrine_ORM_Persisters_StandardEntityPersister extends Doctrine_ORM_Persi
* *
* @param Doctrine_Entity $record The entity to insert. * @param Doctrine_Entity $record The entity to insert.
*/ */
protected function _doInsert(Doctrine_Entity $record) protected function _doInsert(Doctrine_ORM_Entity $record)
{ {
$conn = $this->_conn; $conn = $this->_conn;
...@@ -105,7 +105,7 @@ class Doctrine_ORM_Persisters_StandardEntityPersister extends Doctrine_ORM_Persi ...@@ -105,7 +105,7 @@ class Doctrine_ORM_Persisters_StandardEntityPersister extends Doctrine_ORM_Persi
/** /**
* Updates an entity. * Updates an entity.
*/ */
protected function _doUpdate(Doctrine_Entity $record) protected function _doUpdate(Doctrine_ORM_Entity $record)
{ {
$conn = $this->_conn; $conn = $this->_conn;
$classMetadata = $this->_classMetadata; $classMetadata = $this->_classMetadata;
......
...@@ -66,7 +66,7 @@ class Doctrine_Query_Parser_AbstractSchemaName extends Doctrine_Query_ParserRule ...@@ -66,7 +66,7 @@ class Doctrine_Query_Parser_AbstractSchemaName extends Doctrine_Query_ParserRule
{ {
if (class_exists($componentName)) { if (class_exists($componentName)) {
$reflectionClass = new ReflectionClass($componentName); $reflectionClass = new ReflectionClass($componentName);
$dctrnEntityReflectionClass = new ReflectionClass('Doctrine_Entity'); $dctrnEntityReflectionClass = new ReflectionClass('Doctrine_ORM_Entity');
return $reflectionClass->isSubclassOf($dctrnEntityReflectionClass); return $reflectionClass->isSubclassOf($dctrnEntityReflectionClass);
} }
......
...@@ -18,7 +18,7 @@ class Orm_Entity_AccessorTest extends Doctrine_OrmTestCase ...@@ -18,7 +18,7 @@ class Orm_Entity_AccessorTest extends Doctrine_OrmTestCase
/* Local test classes */ /* Local test classes */
class CustomAccessorMutatorTestEntity extends Doctrine_Entity class CustomAccessorMutatorTestEntity extends Doctrine_ORM_Entity
{ {
public static function initMetadata($mapping) public static function initMetadata($mapping)
{ {
...@@ -48,7 +48,7 @@ class CustomAccessorMutatorTestEntity extends Doctrine_Entity ...@@ -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) public static function initMetadata($mapping)
{ {
......
...@@ -11,7 +11,7 @@ class Orm_Entity_ConstructorTest extends Doctrine_OrmTestCase ...@@ -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) public function __construct($username = null)
{ {
......
...@@ -86,8 +86,8 @@ class Orm_Hydration_BasicHydrationTest extends Doctrine_OrmTestCase ...@@ -86,8 +86,8 @@ class Orm_Hydration_BasicHydrationTest extends Doctrine_OrmTestCase
if ($hydrationMode == Doctrine::HYDRATE_RECORD) { if ($hydrationMode == Doctrine::HYDRATE_RECORD) {
$this->assertTrue($result instanceof Doctrine_Collection); $this->assertTrue($result instanceof Doctrine_Collection);
$this->assertTrue($result[0] instanceof Doctrine_Entity); $this->assertTrue($result[0] instanceof Doctrine_ORM_Entity);
$this->assertTrue($result[1] instanceof Doctrine_Entity); $this->assertTrue($result[1] instanceof Doctrine_ORM_Entity);
} else if ($hydrationMode == Doctrine::HYDRATE_ARRAY) { } else if ($hydrationMode == Doctrine::HYDRATE_ARRAY) {
$this->assertTrue(is_array($result)); $this->assertTrue(is_array($result));
} else if ($hydrationMode == Doctrine::HYDRATE_SCALAR) { } else if ($hydrationMode == Doctrine::HYDRATE_SCALAR) {
...@@ -186,11 +186,11 @@ class Orm_Hydration_BasicHydrationTest extends Doctrine_OrmTestCase ...@@ -186,11 +186,11 @@ class Orm_Hydration_BasicHydrationTest extends Doctrine_OrmTestCase
} }
if ($hydrationMode == Doctrine::HYDRATE_RECORD) { 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'] instanceof Doctrine_Collection);
$this->assertTrue($result[0][0]['phonenumbers'][0] instanceof Doctrine_Entity); $this->assertTrue($result[0][0]['phonenumbers'][0] instanceof Doctrine_ORM_Entity);
$this->assertTrue($result[0][0]['phonenumbers'][1] instanceof Doctrine_Entity); $this->assertTrue($result[0][0]['phonenumbers'][1] instanceof Doctrine_ORM_Entity);
$this->assertTrue($result[1][0] instanceof Doctrine_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'] instanceof Doctrine_Collection);
} else if ($hydrationMode == Doctrine::HYDRATE_SCALAR) { } else if ($hydrationMode == Doctrine::HYDRATE_SCALAR) {
$this->assertTrue(is_array($result)); $this->assertTrue(is_array($result));
...@@ -273,8 +273,8 @@ class Orm_Hydration_BasicHydrationTest extends Doctrine_OrmTestCase ...@@ -273,8 +273,8 @@ class Orm_Hydration_BasicHydrationTest extends Doctrine_OrmTestCase
} }
if ($hydrationMode == Doctrine::HYDRATE_RECORD) { 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[1][0] instanceof Doctrine_Entity); $this->assertTrue($result[1][0] instanceof Doctrine_ORM_Entity);
} else if ($hydrationMode == Doctrine::HYDRATE_SCALAR) { } else if ($hydrationMode == Doctrine::HYDRATE_SCALAR) {
$this->assertEquals(2, count($result)); $this->assertEquals(2, count($result));
...@@ -377,8 +377,8 @@ class Orm_Hydration_BasicHydrationTest extends Doctrine_OrmTestCase ...@@ -377,8 +377,8 @@ class Orm_Hydration_BasicHydrationTest extends Doctrine_OrmTestCase
} }
if ($hydrationMode == Doctrine::HYDRATE_RECORD) { if ($hydrationMode == Doctrine::HYDRATE_RECORD) {
$this->assertTrue($result[0]['1'] instanceof Doctrine_Entity); $this->assertTrue($result[0]['1'] instanceof Doctrine_ORM_Entity);
$this->assertTrue($result[1]['2'] instanceof Doctrine_Entity); $this->assertTrue($result[1]['2'] instanceof Doctrine_ORM_Entity);
$this->assertTrue($result[0]['1']['phonenumbers'] instanceof Doctrine_Collection); $this->assertTrue($result[0]['1']['phonenumbers'] instanceof Doctrine_Collection);
$this->assertEquals(2, count($result[0]['1']['phonenumbers'])); $this->assertEquals(2, count($result[0]['1']['phonenumbers']));
} else if ($hydrationMode == Doctrine::HYDRATE_SCALAR) { } else if ($hydrationMode == Doctrine::HYDRATE_SCALAR) {
...@@ -521,18 +521,18 @@ class Orm_Hydration_BasicHydrationTest extends Doctrine_OrmTestCase ...@@ -521,18 +521,18 @@ class Orm_Hydration_BasicHydrationTest extends Doctrine_OrmTestCase
} }
if ($hydrationMode == Doctrine::HYDRATE_RECORD) { 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'] instanceof Doctrine_Collection);
$this->assertTrue($result[0][0]['phonenumbers'][0] instanceof Doctrine_Entity); $this->assertTrue($result[0][0]['phonenumbers'][0] instanceof Doctrine_ORM_Entity);
$this->assertTrue($result[0][0]['phonenumbers'][1] instanceof Doctrine_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'] instanceof Doctrine_Collection);
$this->assertTrue($result[0][0]['articles'][0] instanceof Doctrine_Entity); $this->assertTrue($result[0][0]['articles'][0] instanceof Doctrine_ORM_Entity);
$this->assertTrue($result[0][0]['articles'][1] instanceof Doctrine_Entity); $this->assertTrue($result[0][0]['articles'][1] instanceof Doctrine_ORM_Entity);
$this->assertTrue($result[1][0] instanceof Doctrine_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'] instanceof Doctrine_Collection);
$this->assertTrue($result[1][0]['phonenumbers'][0] instanceof Doctrine_Entity); $this->assertTrue($result[1][0]['phonenumbers'][0] instanceof Doctrine_ORM_Entity);
$this->assertTrue($result[1][0]['articles'][0] instanceof Doctrine_Entity); $this->assertTrue($result[1][0]['articles'][0] instanceof Doctrine_ORM_Entity);
$this->assertTrue($result[1][0]['articles'][1] instanceof Doctrine_Entity); $this->assertTrue($result[1][0]['articles'][1] instanceof Doctrine_ORM_Entity);
} else if ($hydrationMode == Doctrine::HYDRATE_SCALAR) { } else if ($hydrationMode == Doctrine::HYDRATE_SCALAR) {
//... //...
$this->assertEquals(6, count($result)); $this->assertEquals(6, count($result));
...@@ -705,23 +705,23 @@ class Orm_Hydration_BasicHydrationTest extends Doctrine_OrmTestCase ...@@ -705,23 +705,23 @@ class Orm_Hydration_BasicHydrationTest extends Doctrine_OrmTestCase
} }
if ($hydrationMode == Doctrine::HYDRATE_RECORD) { 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[1][0] instanceof Doctrine_Entity); $this->assertTrue($result[1][0] instanceof Doctrine_ORM_Entity);
// phonenumbers // phonenumbers
$this->assertTrue($result[0][0]['phonenumbers'] instanceof Doctrine_Collection); $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'][0] instanceof Doctrine_ORM_Entity);
$this->assertTrue($result[0][0]['phonenumbers'][1] instanceof Doctrine_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'] 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 // articles
$this->assertTrue($result[0][0]['articles'] instanceof Doctrine_Collection); $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'][0] instanceof Doctrine_ORM_Entity);
$this->assertTrue($result[0][0]['articles'][1] instanceof Doctrine_Entity); $this->assertTrue($result[0][0]['articles'][1] instanceof Doctrine_ORM_Entity);
$this->assertTrue($result[1][0]['articles'][0] instanceof Doctrine_Entity); $this->assertTrue($result[1][0]['articles'][0] instanceof Doctrine_ORM_Entity);
$this->assertTrue($result[1][0]['articles'][1] instanceof Doctrine_Entity); $this->assertTrue($result[1][0]['articles'][1] instanceof Doctrine_ORM_Entity);
// article comments // article comments
$this->assertTrue($result[0][0]['articles'][0]['comments'] instanceof Doctrine_Collection); $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 // empty comment collections
$this->assertTrue($result[0][0]['articles'][1]['comments'] instanceof Doctrine_Collection); $this->assertTrue($result[0][0]['articles'][1]['comments'] instanceof Doctrine_Collection);
$this->assertEquals(0, count($result[0][0]['articles'][1]['comments'])); $this->assertEquals(0, count($result[0][0]['articles'][1]['comments']));
...@@ -849,8 +849,8 @@ class Orm_Hydration_BasicHydrationTest extends Doctrine_OrmTestCase ...@@ -849,8 +849,8 @@ class Orm_Hydration_BasicHydrationTest extends Doctrine_OrmTestCase
$this->assertTrue(is_array($result[1])); $this->assertTrue(is_array($result[1]));
} else if ($hydrationMode == Doctrine::HYDRATE_RECORD) { } else if ($hydrationMode == Doctrine::HYDRATE_RECORD) {
$this->assertTrue($result instanceof Doctrine_Collection); $this->assertTrue($result instanceof Doctrine_Collection);
$this->assertTrue($result[0] instanceof Doctrine_Entity); $this->assertTrue($result[0] instanceof Doctrine_ORM_Entity);
$this->assertTrue($result[1] instanceof Doctrine_Entity); $this->assertTrue($result[1] instanceof Doctrine_ORM_Entity);
} else if ($hydrationMode == Doctrine::HYDRATE_SCALAR) { } else if ($hydrationMode == Doctrine::HYDRATE_SCALAR) {
//... //...
} }
......
...@@ -85,7 +85,7 @@ class Orm_UnitOfWorkTest extends Doctrine_OrmTestCase ...@@ -85,7 +85,7 @@ class Orm_UnitOfWorkTest extends Doctrine_OrmTestCase
public function testRegisterDirty() 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->assertFalse($this->_unitOfWork->isInIdentityMap($this->_user));
$this->_unitOfWork->registerDirty($this->_user); $this->_unitOfWork->registerDirty($this->_user);
$this->assertTrue($this->_unitOfWork->isRegisteredDirty($this->_user)); $this->assertTrue($this->_unitOfWork->isRegisteredDirty($this->_user));
...@@ -105,7 +105,7 @@ class Orm_UnitOfWorkTest extends Doctrine_OrmTestCase ...@@ -105,7 +105,7 @@ class Orm_UnitOfWorkTest extends Doctrine_OrmTestCase
public function testSavingSingleEntityWithIdentityColumnForcesInsert() 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); $this->_unitOfWork->save($this->_user);
...@@ -114,7 +114,7 @@ class Orm_UnitOfWorkTest extends Doctrine_OrmTestCase ...@@ -114,7 +114,7 @@ class Orm_UnitOfWorkTest extends Doctrine_OrmTestCase
$this->assertEquals(0, count($this->_persisterMock->getDeletes())); $this->assertEquals(0, count($this->_persisterMock->getDeletes()));
$this->assertTrue($this->_unitOfWork->isInIdentityMap($this->_user)); $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 // should no longer be scheduled for insert
$this->assertFalse($this->_unitOfWork->isRegisteredNew($this->_user)); $this->assertFalse($this->_unitOfWork->isRegisteredNew($this->_user));
......
...@@ -8,7 +8,7 @@ class Doctrine_EntityPersisterMock extends Doctrine_ORM_Persisters_StandardEntit ...@@ -8,7 +8,7 @@ class Doctrine_EntityPersisterMock extends Doctrine_ORM_Persisters_StandardEntit
private $_identityColumnValueCounter = 0; private $_identityColumnValueCounter = 0;
public function insert(Doctrine_Entity $entity) public function insert(Doctrine_ORM_Entity $entity)
{ {
if ($entity->getClass()->isIdGeneratorIdentity()) { if ($entity->getClass()->isIdGeneratorIdentity()) {
$entity->_assignIdentifier($this->_identityColumnValueCounter++); $entity->_assignIdentifier($this->_identityColumnValueCounter++);
...@@ -18,12 +18,12 @@ class Doctrine_EntityPersisterMock extends Doctrine_ORM_Persisters_StandardEntit ...@@ -18,12 +18,12 @@ class Doctrine_EntityPersisterMock extends Doctrine_ORM_Persisters_StandardEntit
$this->_inserts[] = $entity; $this->_inserts[] = $entity;
} }
public function update(Doctrine_Entity $entity) public function update(Doctrine_ORM_Entity $entity)
{ {
$this->_updates[] = $entity; $this->_updates[] = $entity;
} }
public function delete(Doctrine_Entity $entity) public function delete(Doctrine_ORM_Entity $entity)
{ {
$this->_deletes[] = $entity; $this->_deletes[] = $entity;
} }
......
...@@ -10,7 +10,7 @@ class Doctrine_SequenceMock extends Doctrine_ORM_Id_SequenceGenerator ...@@ -10,7 +10,7 @@ class Doctrine_SequenceMock extends Doctrine_ORM_Id_SequenceGenerator
* @param Doctrine_Entity $entity * @param Doctrine_Entity $entity
* @override * @override
*/ */
public function generate(Doctrine_Entity $entity) public function generate(Doctrine_ORM_Entity $entity)
{ {
return $this->_sequenceNumber++; return $this->_sequenceNumber++;
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#use Doctrine::ORM::Entity; #use Doctrine::ORM::Entity;
class CmsArticle extends Doctrine_Entity class CmsArticle extends Doctrine_ORM_Entity
{ {
#protected $id; #protected $id;
#protected $topic; #protected $topic;
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#use Doctrine::ORM::Entity; #use Doctrine::ORM::Entity;
class CmsComment extends Doctrine_Entity class CmsComment extends Doctrine_ORM_Entity
{ {
#protected $id; #protected $id;
#protected $topic; #protected $topic;
......
<?php <?php
class CmsPhonenumber extends Doctrine_Entity class CmsPhonenumber extends Doctrine_ORM_Entity
{ {
#protected $user_id; #protected $user_id;
#protected $phonenumber; #protected $phonenumber;
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#use Doctrine::ORM::Entity; #use Doctrine::ORM::Entity;
class CmsUser extends Doctrine_Entity class CmsUser extends Doctrine_ORM_Entity
{ {
#protected $id; #protected $id;
#protected $status; #protected $status;
......
<?php <?php
class CompanyEmployee extends Doctrine_Entity class CompanyEmployee extends Doctrine_ORM_Entity
{ {
#protected $id; #protected $id;
#protected $salary; #protected $salary;
......
<?php <?php
class ForumAvatar extends Doctrine_Entity class ForumAvatar extends Doctrine_ORM_Entity
{ {
public static function initMetadata($mapping) public static function initMetadata($mapping)
......
<?php <?php
class ForumBoard extends Doctrine_Entity class ForumBoard extends Doctrine_ORM_Entity
{ {
public static function initMetadata($mapping) public static function initMetadata($mapping)
{ {
......
<?php <?php
class ForumCategory extends Doctrine_Entity class ForumCategory extends Doctrine_ORM_Entity
{ {
public static function initMetadata($mapping) public static function initMetadata($mapping)
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#use Doctrine::ORM::Entity; #use Doctrine::ORM::Entity;
class ForumEntry extends Doctrine_Entity class ForumEntry extends Doctrine_ORM_Entity
{ {
#protected $id; #protected $id;
#protected $topic; #protected $topic;
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#use Doctrine::ORM::Entity; #use Doctrine::ORM::Entity;
class ForumUser extends Doctrine_Entity class ForumUser extends Doctrine_ORM_Entity
{ {
#protected $id; #protected $id;
#protected $username; #protected $username;
......
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