You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 line
745B

  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. }