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

EntitySettingTrait.php 692B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace Lc\CaracoleBundle\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. }