<?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;
    }

}