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

SiteSettingFactory.php 860B

3 年前
3 年前
3 年前
3 年前
1234567891011121314151617181920212223242526
  1. <?php
  2. namespace Lc\SovBundle\Factory\Setting;
  3. use Lc\SovBundle\Container\Setting\SiteSettingContainer;
  4. use Lc\SovBundle\Factory\AbstractFactory;
  5. use Lc\SovBundle\Model\File\FileInterface;
  6. use Lc\SovBundle\Model\Setting\SiteSettingInterface;
  7. use Lc\SovBundle\Model\Site\SiteInterface;
  8. class SiteSettingFactory extends AbstractFactory implements SiteSettingFactoryInterface
  9. {
  10. public function create(SiteInterface $site, string $name, string $text = null, \DateTime $date = null, FileInterface $file = null): SiteSettingInterface
  11. {
  12. $class = SiteSettingContainer::getEntityFqcn();
  13. $siteSetting = new $class;
  14. $siteSetting->setSite($site);
  15. $siteSetting->setName($name);
  16. $siteSetting->setText($text);
  17. $siteSetting->setDate($date);
  18. $siteSetting->setFile($file);
  19. return $siteSetting;
  20. }
  21. }