forked from codeigniter4/CodeIgniter4
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avibility to change mutateDate behaviour
Adds possibility to set mutateDate to return \DateTime instead of \CodeIgniter\I18n\Time instances. To make it work simpy use this code in your Entity child constructor: ``` public function __construct(?array $data = null) { parent::__construct($data, ['dateMutateAs' => 'DateTime']); } ``` or ``` public function __construct(?array $data = null) { parent::__construct($data); $this->setMutateDateAs('DateTime'); // will return boolean - value changed === true. } ``` I think it is required to add some code to make timezone changes work for \CodeIgniter\I18n\Time instance. For make this work in predictable way I think we should make some changes in \CodeIgniter\I18n\Time (codeigniter4#1807)
- Loading branch information
1 parent
ba4f258
commit f276a32
Showing
1 changed file
with
130 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters