Skip to content

Commit cb0b5f6

Browse files
committed
Clear ClassMetadata::(get|set)FieldValue using propertyAccessors
1 parent d99f6cb commit cb0b5f6

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadata.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1980,14 +1980,6 @@ public function getIdentifierObject(object $document)
19801980
*/
19811981
public function setFieldValue(object $document, string $field, $value): void
19821982
{
1983-
if ($document instanceof InternalProxy && ! $document->__isInitialized()) {
1984-
//property changes to an uninitialized proxy will not be tracked or persisted,
1985-
//so the proxy needs to be loaded first.
1986-
$document->__load();
1987-
} elseif ($document instanceof GhostObjectInterface && ! $document->isProxyInitialized()) {
1988-
$document->initializeProxy();
1989-
}
1990-
19911983
$this->propertyAccessors[$field]->setValue($document, $value);
19921984
}
19931985

@@ -1998,12 +1990,6 @@ public function setFieldValue(object $document, string $field, $value): void
19981990
*/
19991991
public function getFieldValue(object $document, string $field)
20001992
{
2001-
if ($document instanceof InternalProxy && $field !== $this->identifier && ! $document->__isInitialized()) {
2002-
$document->__load();
2003-
} elseif ($document instanceof GhostObjectInterface && $field !== $this->identifier && ! $document->isProxyInitialized()) {
2004-
$document->initializeProxy();
2005-
}
2006-
20071993
return $this->propertyAccessors[$field]->getValue($document);
20081994
}
20091995

0 commit comments

Comments
 (0)