File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -1735,7 +1735,18 @@ protected function timeToString(array $properties): array
17351735 */
17361736 protected function objectToRawArray ($ object , bool $ onlyChanged = true , bool $ recursive = false ): array
17371737 {
1738- if ($ object instanceof Entity) {
1738+ /**
1739+ * @deprecated 4.4.4 Checking `toRawArray()` method is deprecated.
1740+ */
1741+ if (method_exists ($ object , 'toRawArray ' )) {
1742+ if (! $ object instanceof Entity) {
1743+ @trigger_error (
1744+ 'In Model, to use your own class that implemented the "toRawArray()" method is deprecated. '
1745+ . ' It will be changed so that "toRawArray()" is only executed if the object is an CodeIgniter \'s "Entity". ' ,
1746+ E_USER_DEPRECATED
1747+ );
1748+ }
1749+
17391750 $ properties = $ object ->toRawArray ($ onlyChanged , $ recursive );
17401751 } else {
17411752 $ mirror = new ReflectionClass ($ object );
You can’t perform that action at this time.
0 commit comments