Having upgraded to Chronos 2.4.0 - I have fixed the majority of deprecations in my application, but in a few places I am getting a warning like:
deprecated: 16384 :: 2.5 setTimezone() will be removed in 3.x.
What’s confusing me is that there is no custom logic in these places - by that I means it’s the normal kind of code you get after baking a Controller…
- Get the request data
- Create or patch and entity with the data
- Call the save method.
I’m a bit stuck on what I can do to fix this deprecation - and it only seems to occur when the entity has a date type field, for example:
/**
* Bonus Entity
*
* @property int $id
* @property float|null $quarter_target
* @property float|null $progress
* @property \Cake\I18n\FrozenDate $target_period_date
* @property int|null $quarter
* @property \Cake\I18n\FrozenTime $created
* @property \Cake\I18n\FrozenTime $modified
*/
class Bonus extends Entity
{
/**
* Fields that can be mass assigned using newEntity() or patchEntity().
*
* Note that when '*' is set to true, this allows all unspecified fields to
* be mass assigned. For security purposes, it is advised to set '*' to false
* (or remove it), and explicitly make individual fields accessible as needed.
*
* @var array
*/
protected $_accessible = [
'quarter_target' => true,
'progress' => true,
'target_period_date' => true,
'quarter' => true,
'created' => true,
'modified' => true,
];
}