public static function getTotalCount() : int
 {
     $db = DataBaseHelper::getConnection();
     $handle = $db->prepare('SELECT COUNT(*) FROM Orders;');
     $handle->execute();
     $amount = (int) $handle->fetchColumn();
     //close database connection
     $db = null;
     return $amount ?? 0;
 }
 public static function getTopByNumOfOrders($dateFrom = null, $dateTo = null, int $limit = 10) : array
 {
     $db = DataBaseHelper::getConnection();
     list($dateFrom, $dateTo) = DateHelper::formatDates($dateFrom, $dateTo);
     $handle = static::queryTopByNumOfOrders($dateFrom, $dateTo, $limit, $db);
     // create customers
     foreach ($handle as $customer) {
         $customers[] = static::createNew($customer);
     }
     //close database connection
     $db = null;
     return $customers ?? [];
 }