cakephp / docs

CakePHP CookBook
http://book.cakephp.org
Other
679 stars 2.58k forks source link

Remove outdated info about Date and Time classes. #7902

Closed ADmad closed 3 months ago

LordSimal commented 3 months ago

I'd add a separate info block where it specifically states, that you cant compare objects anymore.

ADmad commented 3 months ago

That could be done in a follow up PR.

othercorey commented 3 months ago

If we do that, we should just give an example of how to convert to a comparable object or we should add a helper to compare dates.

LordSimal commented 3 months ago

well to restore previous functionality one would have to convert

$date <= $dateTime

to

$date->toNative() <= $dateTime->toNative() 

or is there a simpler way?

Adding another helper wouldn't realy solve the breaking change as far as I can tell.

Because there is already e.g. ->lessThan() but those still require the same object type being passed down, not other types.

ADmad commented 3 months ago

I have added a note for Date. Feel free to modify the wording.