use Lc\CaracoleBundle\Model\PointSale\PointSaleInterface; | use Lc\CaracoleBundle\Model\PointSale\PointSaleInterface; | ||||
use Lc\CaracoleBundle\Model\Product\ProductCategoryInterface; | use Lc\CaracoleBundle\Model\Product\ProductCategoryInterface; | ||||
use Lc\CaracoleBundle\Model\Product\ProductFamilyInterface; | use Lc\CaracoleBundle\Model\Product\ProductFamilyInterface; | ||||
use Lc\CaracoleBundle\Model\Setting\EntitySettingTrait; | |||||
use Lc\CaracoleBundle\Model\Setting\MerchantSettingInterface; | use Lc\CaracoleBundle\Model\Setting\MerchantSettingInterface; | ||||
use Lc\SovBundle\Model\Setting\EntitySettingTrait; | |||||
use Lc\SovBundle\Model\Site\NewsInterface; | use Lc\SovBundle\Model\Site\NewsInterface; | ||||
use Lc\SovBundle\Model\Site\PageInterface; | use Lc\SovBundle\Model\Site\PageInterface; | ||||
use Lc\SovBundle\Model\User\GroupUserInterface; | use Lc\SovBundle\Model\User\GroupUserInterface; |
use Lc\CaracoleBundle\Model\Order\OrderShopInterface; | use Lc\CaracoleBundle\Model\Order\OrderShopInterface; | ||||
use Lc\CaracoleBundle\Model\Product\ProductCategoryInterface; | use Lc\CaracoleBundle\Model\Product\ProductCategoryInterface; | ||||
use Lc\CaracoleBundle\Model\Product\ProductFamilyInterface; | use Lc\CaracoleBundle\Model\Product\ProductFamilyInterface; | ||||
use Lc\CaracoleBundle\Model\Setting\EntitySettingTrait; | |||||
use Lc\CaracoleBundle\Model\Setting\SectionSettingInterface; | use Lc\CaracoleBundle\Model\Setting\SectionSettingInterface; | ||||
use Lc\SovBundle\Model\Setting\EntitySettingTrait; | |||||
use Lc\SovBundle\Model\Site\PageInterface; | use Lc\SovBundle\Model\Site\PageInterface; | ||||
use Lc\SovBundle\Doctrine\Pattern\AbstractFullEntity; | use Lc\SovBundle\Doctrine\Pattern\AbstractFullEntity; | ||||
<?php | |||||
namespace Lc\CaracoleBundle\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; | |||||
} | |||||
} |