entity - How can I get all the modified fields before saving the editing in cake php? -
using
$entity->errors(); //is returning errors.
to find changes before upgrading there
$entity = $this->controller->patchentity($entity , $this->request->data); echo $entity->diff (); // how?
i guess looking for:
$entity->dirty()
if want array containing alla dirty properties can do
$entity->name = 'foo'; $entity->description = 'bar'; debug($entity->extract($entity->visibleproperties(), true));
you'll
[ 'name' => 'foo', 'abbreviation' => 'bar' ]
see manual
Comments
Post a Comment