Class EntitySnapshot
Definition at line 15 of file EntitySnapshot.php.
◆ __construct()
◆ isModified()
isModified |
( |
|
$entityType, |
|
|
|
$entity |
|
) |
| |
Check is current entity has changes, by comparing current object state with stored snapshot
- Parameters
-
string | $entityType | |
object | $entity | |
- Returns
- bool
Definition at line 68 of file EntitySnapshot.php.
70 $metadata = $this->metadataPool->getMetadata(
$entityType);
71 $hydrator = $this->metadataPool->getHydrator(
$entityType);
72 $entityData = $hydrator->extract(
$entity);
73 if (empty($entityData[$metadata->getIdentifierField()])) {
76 $identifier = $entityData[$metadata->getIdentifierField()];
77 if (!isset($this->snapshotData[
$entityType][$identifier])) {
81 if (isset($entityData[$field]) && $entityData[$field] !=
$value) {
◆ registerSnapshot()
registerSnapshot |
( |
|
$entityType, |
|
|
|
$entity |
|
) |
| |
- Parameters
-
string | $entityType | |
object | $entity | |
- Returns
- void
Definition at line 51 of file EntitySnapshot.php.
53 $metadata = $this->metadataPool->getMetadata(
$entityType);
54 $hydrator = $this->metadataPool->getHydrator(
$entityType);
55 $entityData = $hydrator->extract(
$entity);
57 $this->snapshotData[
$entityType][$entityData[$metadata->getIdentifierField()]]
◆ $attributeProvider
◆ $metadataPool
◆ $snapshotData
The documentation for this class was generated from the following file: