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

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

c - Unrecognised emulation mode: elf_i386 on MinGW32 -