|
- <?php
-
- namespace Lc\CaracoleBundle\Factory\Section;
-
- use App\Entity\Section\Opening;
- use Lc\CaracoleBundle\Factory\SectionFactoryTrait;
- 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 {
- $opening = new Opening();
-
- $opening->setSection($section);
-
- if($day) {
- $opening->setDay($day);
- }
-
- $opening->setTimeStart($timeStart);
- $opening->setTimeEnd($timeEnd);
- $opening->setGroupUser($groupUser);
-
- return $opening;
- }
-
- }
|