php - Is it possible to detect the field type of a MySQL field in CakePHP? -
I plan to convert all date time data from a MySQL database to the format date ('D-M-Y') I am making I'm thinking of doing it in AfterFind () callback, but I'm wondering, how does the KPHP detect field types so that I can make conditional statements?
Thanks in advance!
Closing the top of my head: model :: $ _ schema
database table For the field type, it is encoded by the cake using the SQL DESCRIBE
questions, to find out the type of field you have in your query results in a afterFind ()
Callback and Access $ this- & gt; _schema
. debug ($ this-> _schema); Try
to see how it is structured.