The example has:
$connection = ConnectionManager::get('default');
$results = $connection
'SELECT * FROM articles WHERE created >= :created',
['created' => new DateTime('1 day ago')],
['created' => 'datetime']
This doesn’t seem to make sense, why twice?
Reference: Database Basics - 5.x
If you look at the API definition for the Connection::execute method you will see, that the 3rd parameter is to tell CakePHP what kind of type the given value is
So its kind of a casting parameter before the query is being executed.
But you shouldn’t need to specify the 3rd parameter if the column
created is already a
datetime column type in your DBMS.