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.

33 lines
687B

  1. <?php
  2. namespace Lc\SovBundle\Model\Setting;
  3. trait EntitySettingTrait
  4. {
  5. public function getSetting($name)
  6. {
  7. if ($this->getSettings()) {
  8. foreach ($this->getSettings() as $setting) {
  9. if ($setting->getName() == $name) {
  10. return $setting;
  11. }
  12. }
  13. }
  14. return false;
  15. }
  16. public function getSettingValue($name)
  17. {
  18. if ($this->getSettings()) {
  19. foreach ($this->getSettings() as $setting) {
  20. if ($setting->getName() == $name) {
  21. return $setting->getValue();
  22. }
  23. }
  24. }
  25. return false;
  26. }
  27. }