| Methods |
public
|
find<T is object>(class-string<T> $className, mixed $id): object|null
Finds an object by its identifier.
Finds an object by its identifier.
This is just a convenient shortcut for getRepository($className)->find($id).
Parameters
| $id |
The identity of the object to find.
|
Returns
Implemented by
|
#
|
public
|
persist(object $object): void
Tells the ObjectManager to make an instance managed and persistent.
Tells the ObjectManager to make an instance managed and persistent.
The object will be entered into the database as a result of the flush operation.
NOTE: The persist operation always considers objects that are not yet known to
this ObjectManager as NEW. Do not pass detached objects to the persist operation.
Parameters
| $object |
The instance to make managed and persistent.
|
Implemented by
|
#
|
public
|
remove(object $object): void
Removes an object instance.
Removes an object instance.
A removed object will be removed from the database as a result of the flush operation.
Parameters
| $object |
The object instance to remove.
|
Implemented by
|
#
|
public
|
clear(): void
Clears the ObjectManager. All objects that are currently managed
by this ObjectManager become detached.
Clears the ObjectManager. All objects that are currently managed
by this ObjectManager become detached.
Implemented by
|
#
|
public
|
detach(object $object): void
Detaches an object from the ObjectManager, causing a managed object to
become detached. Unflushed changes made to the…
Detaches an object from the ObjectManager, causing a managed object to
become detached. Unflushed changes made to the object if any
(including removal of the object), will not be synchronized to the database.
Objects which previously referenced the detached object will continue to
reference it.
Parameters
| $object |
The object to detach.
|
Implemented by
|
#
|
public
|
refresh(object $object): void
Refreshes the persistent state of an object from the database,
overriding any local changes that have not yet been…
Refreshes the persistent state of an object from the database,
overriding any local changes that have not yet been persisted.
Parameters
| $object |
The object to refresh.
|
Implemented by
|
#
|
public
|
flush(): void
Flushes all changes to objects that have been queued up to now to the database.
This effectively synchronizes the in…
Flushes all changes to objects that have been queued up to now to the database.
This effectively synchronizes the in-memory state of managed objects with the
database.
Implemented by
|
#
|
public
|
getRepository<T is object>(class-string<T> $className)
Gets the repository for a class.
Gets the repository for a class.
Implemented by
|
#
|
public
|
getClassMetadata<T is object>(class-string<T> $className)
Returns the ClassMetadata descriptor for a class.
Returns the ClassMetadata descriptor for a class.
The class name must be the fully-qualified class name without a leading backslash
(as it is returned by get_class($obj)).
Implemented by
|
#
|
public
|
getMetadataFactory()
Gets the metadata factory used to gather the metadata of classes.
Gets the metadata factory used to gather the metadata of classes.
Implemented by
|
#
|
public
|
initializeObject(object $obj): void
Helper method to initialize a lazy loading proxy or persistent collection.
Helper method to initialize a lazy loading proxy or persistent collection.
This method is a no-op for other objects.
Implemented by
|
#
|
public
|
contains(object $object): bool
Checks if the object is part of the current UnitOfWork and therefore managed.
Checks if the object is part of the current UnitOfWork and therefore managed.
Implemented by
|
#
|