propelorm/Propel2 — pull request #768 by dhm80 (2014-10-06 21:02:37+00:00)
Title: Fix wrong DateTime comparison in setter methods

Hey there,

I noticed that the setter methods don't check for modified columns correctly when handling `date`, `time` or `timestamp` values.

One problem was that on every call first a new instance of the given date and/or time parameter `$v` was generated and then compared via php's `!==` operator (which checks if two variables reference the same object and NOT if the values are equal). The result could not become true as there were always two different objects that were compared.

Another "problem" was that when e. g. comparing objects belonging to a `date` column the time part should not be considered, etc. (even if an object is given to the setter method).

An example:
```php
$test = TimingQuery::create()
->filterById(123)
->findOneOrCreate()
;

$almostTomorrow = new \DateTime("tomorrow -1 second");
$test
->setDate($almostTomorrow)
->setTime($almostTomorrow)
->setDateTime($almostTomorrow)
;

// should only be true on first execution
echo "isModified: " . (int) $test->isModified() . "\n";

if ($test->isNew()) {
$test->setId(null);
}

$test->save();
```

So I searched the generator classes and found the part responsible for generating setter methods for mutable columns.

Please have a look at my changes and let me know if there is a better way to solve the problem or you need any other information.

Otherwise: thanks for merging ;)