<commit_before><?php

namespace MillerVein\CalendarBundle\Model;

use DateInterval;
use DateTime;
use Doctrine\ORM\EntityManager;
use MillerVein\CalendarBundle\Entity\Appointment\PatientAppointment;

/**
 * @author <NAME> <<EMAIL>>
 */
class AppointmentFinder {

    protected $em;

    public function __construct(EntityManager $em) {
        $this->em = $em;
    }

    public function findAppointments(AppointmentFinderRequest $appt_request) {
        $appts = array();
        $startDate = clone $appt_request->getMinDate();
        $endDate = clone $appt_request->getMaxDate();
        $dateInterval = new DateInterval("P1D");
        $colRepo = $this->em->getRepository('MillerVeinCalendarBundle:Column');
        $apptRepo = $this->em->getRepository('MillerVeinCalendarBundle:Appointment\Appointment');
        $category = $appt_request->getCategory();
        $duration = $appt_request->getDuration();
        $dayOfWeek = $appt_request->getDayOfWeek();
        $minTime = $appt_request->getMinTime();
        $maxTime = $appt_request->getMaxTime();

        //Loop Days
        for ($workingDate = clone $startDate; $workingDate <= $endDate; $workingDate->add($dateInterval)) {
            if ($dayOfWeek !== null && $workingDate->format('N') != $dayOfWeek) {
                continue;
            }
            $cols = $colRepo->findBySiteAndCategory($appt_request->getSite(), $category);

            //Loop Columns
            foreach ($cols as $column) {
                /* @var $column \MillerVein\CalendarBundle\Entity\Column */
                /* @var $hours \MillerVein\CalendarBundle\Entity\Hours */
                $hours = $column->findHours($workingDate);
                if (!$hours) {
                    continue;<commit_msg>Fixed bug in appointment finder for closed days<commit_after><?php

namespace MillerVein\CalendarBundle\Model;

use DateInterval;
use DateTime;
use Doctrine\ORM\EntityManager;
use MillerVein\CalendarBundle\Entity\Appointment\PatientAppointment;

/**
 * @author <NAME> <<EMAIL>>
 */
class AppointmentFinder {

    protected $em;

    public function __construct(EntityManager $em) {
        $this->em = $em;
    }

    public function findAppointments(AppointmentFinderRequest $appt_request) {
        $appts = array();
        $startDate = clone $appt_request->getMinDate();
        $endDate = clone $appt_request->getMaxDate();
        $dateInterval = new DateInterval("P1D");
        $colRepo = $this->em->getRepository('MillerVeinCalendarBundle:Column');
        $apptRepo = $this->em->getRepository('MillerVeinCalendarBundle:Appointment\Appointment');
        $category = $appt_request->getCategory();
        $duration = $appt_request->getDuration();
        $dayOfWeek = $appt_request->getDayOfWeek();
        $minTime = $appt_request->getMinTime();
        $maxTime = $appt_request->getMaxTime();

        //Loop Days
        for ($workingDate = clone $startDate; $workingDate <= $endDate; $workingDate->add($dateInterval)) {
            if ($dayOfWeek !== null && $workingDate->format('N') != $dayOfWeek) {
                continue;
            }
            $cols = $colRepo->findBySiteAndCategory($appt_request->getSite(), $category);

            //Loop Columns
            foreach ($cols as $column) {
                /* @var $column \MillerVein\CalendarBundle\Entity\Column */
                /* @var $hours \MillerVein\CalendarBundle\Entity\Hours */
                $hours = $column->findHours($workingDate);
                if (!$hours || !$hours->isOpen()) {
                    continue;
{'fraction_non_alphanumeric': 0.13847452856740783, 'fraction_numerical': 0.0005629045876723895, 'mean_word_length': 2.784877529286475, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 44, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '824991', 'n_tokens_mistral': 1059, 'n_tokens_neox': 1019, 'n_words': 183}