UnionOfRAD/lithium — pull request #423 by jmglsn (2012-04-12 13:24:03+00:00)
Title: Entity->modified() dosn't take care of non modified fields

*Sorry for duplicate request, did not find a way to change previous to /dev/ :(*

I'm using some time expensive validators, which should only be executed if the underlying field really was changed.
So I tried to use `modified()`, but it always says that all fields of my entity are changed. Not surprising since the docblock says it always return true for all fields. But in combination with `sync()` it shouldn't do that.

So changed the behavior of `Entity->modified()` to take care about real changes.

**DocumentTest**

```php
public function testSyncModified() {
$doc = new Document();
$doc->id = 4;
$doc->name = 'Four';
$doc->content = 'Lorem ipsum four';

$expected = array(
'id' => true,
'name' => true,
'content' => true,
);

$this->assertEqual($expected, $doc->modified());
$doc->sync();

$this->assertEqual(array_fill_keys(array_keys($expected), false), $doc->modified());

$doc->id = 5;
$doc->content = null;
$doc->new = null;
$expected = array(
'id' => true,
'name' => false,
'content' => true,
'new' => true,
);

$this->assertEqual($expected, $doc->modified());
}
```