I'm trying to use a class Built-in
of PHP
inside CakePHP but it's returned one:
Error: Class 'App \ Controller \ Component \ DateTime' not found
Where it's being used:
public function listNewBanners($newBannersQuantity)
{
$newBanners = TableRegistry::get('new_banners');
$query = $newBanners->find();
$query->select(['path_banner', 'date_start', 'date_end'])
->where(['date_start <' => new DateTime('today')])
->limit($newBannersQuantity);
return $query;
}
Link to official documentation where I saw this class being used: Documentation