您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

40 行
984B

  1. <?php
  2. namespace Lc\CaracoleBundle\Factory\Section;
  3. use App\Entity\Section\Opening;
  4. use Lc\CaracoleBundle\Container\Section\OpeningContainer;
  5. use Lc\CaracoleBundle\Context\SectionContextTrait;
  6. use Lc\CaracoleBundle\Model\Section\SectionInterface;
  7. use Lc\SovBundle\Factory\AbstractFactory;
  8. use Lc\SovBundle\Model\User\GroupUserInterface;
  9. class OpeningFactory extends AbstractFactory
  10. {
  11. public function create(
  12. SectionInterface $section,
  13. int $day = null,
  14. \DateTime $timeStart = null,
  15. \DateTime $timeEnd = null,
  16. GroupUserInterface $groupUser = null
  17. ): Opening {
  18. $class = OpeningContainer::getEntityFqcn();
  19. $opening = new $class;
  20. $opening->setSection($section);
  21. if($day) {
  22. $opening->setDay($day);
  23. }
  24. $opening->setTimeStart($timeStart);
  25. $opening->setTimeEnd($timeEnd);
  26. $opening->setGroupUser($groupUser);
  27. return $opening;
  28. }
  29. }