UnionOfRAD/lithium — pull request #422 by jmglsn (2012-04-12 09:10:56+00:00)
Title: Entity->modified() dosn't take care of non modified fields

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());
}
```