public static function getWorkingDaysCount($beginDate, $endDate, $nonWorkingDays = [])
    {
        $workdays = 0;
        if (!is_null($beginDate) && !is_null($endDate)) {
            if ($beginDate > $endDate) {
                $temp = $beginDate;
                $beginDate = $endDate;
                $endDate = $temp;
            }
            $oneDayInterval = new DateInterval('P1D');
            $date = clone $beginDate;
            while (self::compareDateWithoutTime($date, $endDate) <= 0) {
                $weekday = $date->format('N');
                if (!in_array($weekday, $nonWorkingDays)) {
                    $workdays++;
                }
                $date->add($oneDayInterval);
            }
        }

        return $workdays;
    }