|
1234567891011121314151617181920212223242526272829303132333435 |
- <?php
-
- namespace Lc\SovBundle\Model\Setting;
-
- //TODO à déplacer dans un solver
-
- trait EntitySettingTrait
- {
- public function getSetting($name): ?SettingModel
- {
- if ($this->getSettings()) {
- foreach ($this->getSettings() as $setting) {
- if ($setting->getName() == $name) {
- return $setting;
- }
- }
- }
-
- return null;
- }
-
- public function getSettingValue($name): ?string
- {
- if ($this->getSettings()) {
- foreach ($this->getSettings() as $setting) {
- if ($setting->getName() == $name) {
- return $setting->getValue();
- }
- }
- }
-
- return null;
- }
-
- }
|