Gets the state of an entity with regard to the current unit of work.
Signature
public function getEntityState(
$entity,
[integer
$assume = null] )
Parameters
$entity
—
object
$assume
—
integer
The state to assume if the state is not yet known (not MANAGED or REMOVED). This parameter can be set to improve performance of entity state detection by potentially avoiding a database lookup if the distinction between NEW and DETACHED is either known or does not matter for the caller of the method.