5

I frequently use the Extbase DebugUtility (Tx_Extbase_Utility_Debugger::var_dump($object)). It displays additional data for each property, especially the "modified" flag - see screenshot.

How can I access this "meta property" from within my controller (updateAction)? I tried $object->getProperty->isModified and other combinations, to no avail.

enter image description here

Mateng
  • 3,742
  • 5
  • 37
  • 64

1 Answers1

4

There is a method $yourObject->_isDirty("propertyName") which returns true if it has been modified (see documentation).

If your property is a collection itself, then just use $yourObject->getWhatevers()->_isDirty() (see documentation).

Michael
  • 2,309
  • 1
  • 23
  • 34
  • Also very helpful: The sibling function `_memorizeCleanState()`. I think I can use that to compare previous to modified values. Thanks Michael. – Mateng Jul 18 '13 at 20:40
  • Update: in a current project, I'm accessing the unmodified value with: `$oldValue = $object->_getCleanProperty('value');` – Mateng May 10 '17 at 22:21