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

EntitySettingTrait.php 745B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace Lc\SovBundle\Model\Setting;
  3. //TODO à déplacer dans un solver
  4. trait EntitySettingTrait
  5. {
  6. public function getSetting($name): ?SettingModel
  7. {
  8. if ($this->getSettings()) {
  9. foreach ($this->getSettings() as $setting) {
  10. if ($setting->getName() == $name) {
  11. return $setting;
  12. }
  13. }
  14. }
  15. return null;
  16. }
  17. public function getSettingValue($name): ?string
  18. {
  19. if ($this->getSettings()) {
  20. foreach ($this->getSettings() as $setting) {
  21. if ($setting->getName() == $name) {
  22. return $setting->getValue();
  23. }
  24. }
  25. }
  26. return null;
  27. }
  28. }