Selaa lähdekoodia

Correctif EntitySettingTrait

feature/symfony6.1
Guillaume 2 vuotta sitten
vanhempi
commit
393d6d3f00
2 muutettua tiedostoa jossa 34 lisäystä ja 1 poistoa
  1. +33
    -0
      Model/Setting/EntitySettingTrait.php
  2. +1
    -1
      Model/Site/SiteModel.php

+ 33
- 0
Model/Setting/EntitySettingTrait.php Näytä tiedosto

@@ -0,0 +1,33 @@
<?php

namespace Lc\SovBundle\Model\Setting;

trait EntitySettingTrait
{
public function getSetting($name)
{
if ($this->getSettings()) {
foreach ($this->getSettings() as $setting) {
if ($setting->getName() == $name) {
return $setting;
}
}
}

return false;
}

public function getSettingValue($name)
{
if ($this->getSettings()) {
foreach ($this->getSettings() as $setting) {
if ($setting->getName() == $name) {
return $setting->getValue();
}
}
}

return false;
}

}

+ 1
- 1
Model/Site/SiteModel.php Näytä tiedosto

@@ -5,7 +5,7 @@ namespace Lc\SovBundle\Model\Site;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Lc\CaracoleBundle\Model\Setting\EntitySettingTrait;
use Lc\SovBundle\Model\Setting\EntitySettingTrait;
use Lc\SovBundle\Model\Setting\SiteSettingInterface;
use Lc\SovBundle\Doctrine\EntityInterface;
use Lc\SovBundle\Doctrine\Extension\DevAliasInterface;

Loading…
Peruuta
Tallenna