Pārlūkot izejas kodu

OpeningResolver : Adaptation système de congés

packProduct
Guillaume pirms 2 gadiem
vecāks
revīzija
41186010c6
1 mainītis faili ar 12 papildinājumiem un 2 dzēšanām
  1. +12
    -2
      Resolver/OpeningResolver.php

+ 12
- 2
Resolver/OpeningResolver.php Parādīt failu

@@ -121,18 +121,21 @@ class OpeningResolver
}

// isHolidays
public function isClosingPeriod(SectionInterface $section = null)
public function isClosingPeriod(SectionInterface $section = null, \DateTime $date = null)
{
if (is_null($section)) {
$section = $this->sectionResolver->getCurrent();
}

$date = new \DateTime();
if(is_null($date)) {
$date = new \DateTime();
}

$orderClosedStart = $this->settingSolver->getSettingValue(
$section,
SectionSettingDefinition::SETTING_ORDER_CLOSED_START
);

$orderClosedEnd = $this->settingSolver->getSettingValue(
$section,
SectionSettingDefinition::SETTING_ORDER_CLOSED_END
@@ -246,6 +249,13 @@ class OpeningResolver
}

$date = new \DateTime();
if($this->isClosingPeriod($section)) {
$date = $this->settingSolver->getSettingValue(
$section,
SectionSettingDefinition::SETTING_ORDER_CLOSED_END
);
}

$openingArray = $this->openingStore
->setSection($section)
->get();

Notiek ielāde…
Atcelt
Saglabāt