|
- <?php
-
- namespace Lc\CaracoleBundle\Factory\Section;
-
- use App\Entity\Section\Opening;
- use Lc\CaracoleBundle\Container\Section\OpeningContainer;
- use Lc\CaracoleBundle\Context\SectionContextTrait;
- use Lc\CaracoleBundle\Model\Section\SectionInterface;
- use Lc\SovBundle\Factory\AbstractFactory;
- use Lc\SovBundle\Model\User\GroupUserInterface;
-
- class OpeningFactory extends AbstractFactory
- {
-
- public function create(
- SectionInterface $section,
- int $day = null,
- \DateTime $timeStart = null,
- \DateTime $timeEnd = null,
- GroupUserInterface $groupUser = null
- ): Opening {
-
- $class = OpeningContainer::getEntityFqcn();
- $opening = new $class;
-
- $opening->setSection($section);
-
- if($day) {
- $opening->setDay($day);
- }
-
- $opening->setTimeStart($timeStart);
- $opening->setTimeEnd($timeEnd);
- $opening->setGroupUser($groupUser);
-
- return $opening;
- }
-
- }
|