Add setting.

@param RoleSettingInterface $setting

@return Role
967621
public function addSetting(RoleSettingInterface $setting)
    {
        $this->settings->set($setting->getKey(), $setting);

        return $this;
    }
180588
protected function buildContexts(RoleInterface $role)
    {
        $contexts = null;

        if ($role instanceof OrganizationalInterface) {
            $contexts = [null !== $role->getOrganization() ? PermissionContexts::ORGANIZATION_ROLE : PermissionContexts::ROLE];
        }

        return $contexts;
    }
567774
public function importSetting($setting)
    {
        $short_name = basename(str_replace('\\', '/', get_class($setting)));

        $method = 'importSetting' . $short_name;

        if (method_exists($this, $method)) {
            $this->$method($setting);
        }
    }
956663
public function getSetting($setting)
    {
        return $this->db->select()
            ->from($this->getTable())
            ->where(array(
            'setting_key' => $setting
        ))
            ->get();
    }
291914
public function addConfigSettings(array $settings) {
        $this->config = $this->arrayMergeRecursiveOverwrite(
            $this->config,
            $settings
        );

        return $this;
    }
485006
public static function getGroupSetting ($group, $setting)
	{
		return isset (self::$resourceSettings[$group][$setting])? self::$resourceSettings[$group][$setting] : FALSE;
	}
355796
public function setSettings(array $settings = []) : self
    {
        $this->settings = array_merge($this->settings, $settings);
        // loop through checking each setting
        foreach ($this->allowedSettings as $name => $allowed) {
            $this->validateSettings->__invoke($name, $this->settings[$name], $allowed);
        }

        return $this;
    }
760889
public function addBelongTo(RoleInterface $role)
    {
        $name = $role->getType();
        $id = $role->getId();

        if (!isset($this->belongTo[$name][$id])) {
            if (!isset($this->belongTo[$name])) {
                $this->belongTo[$name] = [];
            }

            $this->belongTo[$name][$id] = $role;
        }

        return $this;
    }
1351453
public function addAdjustment(AdjustmentInterface $adjustment)
    {
        if (!$this->hasAdjustment($adjustment)) {
            $this->adjustmentsTotal = null;
            $this->onAdjustmentsChange();
            $adjustment->setAdjustable($this);
            $this->adjustments->add($adjustment);
        }

        return $this;
    }
583535
protected function loadScript($settings)
    {
        if ($this->scripts !== null) {
            $this->scripts->add($settings);
        }

        return $this;
    }
266474
public function changeDatabase(array $setting)
    {
        $pdoCon = new Pdo($setting);
        $pdoCon->setVitex($this->vitex);
        $this->DB = $pdoCon;
        $this->pdo = $this->DB->pdo;
        return $this;
    }
625957
protected function _addRoles($roles)
    {
        foreach($roles as $role) {
            if (!$this->hasRole($role->getName())) {
                $parents = $role->getParents()->toArray();
                $parentNames = array();
                foreach($parents as $parent) {
                    $parentNames[] = $parent->getName();
                }
                $this->addRole(new Role($role->getName()), $parentNames);
            }
        }

        return $this;
    }
144545
public function setting($setting, $default = null)
    {
        $value = parent::setting($setting);
        if (null === $value) {
            $value = isset(static::$globalSettings[$setting]) ? static::$globalSettings[$setting] : $default;
        }

        return $value;
    }
727990
public function addNotificationSettings(UserNotificationSetting $notificationSetting)
    {
        $this->notificationSettings->set($notificationSetting->getName(), $notificationSetting);

        return $this;
    }
1172285
public function add(ObjectInterface ...$objects)
    {
        foreach ($objects as $object)
        {
            if ($object instanceof RoleInterface)
            {
                $this->addRole((string)$object);
            }
            else if ($object instanceof ResourceInterface)
            {
                $this->addResource((string)$object);
            }
            else if ($object instanceof PermissionInterface)
            {
                $this->addPermission((string)$object);
            }
            else {
                throw new \Exception(
                    sprintf(
                        "%s must implement one of RoleInterface, '.
                        'ResourceInterface and PermissionInterface",
                        $object
                    )
                );
            }   
        }
    }
1163254
public function addSlave(array $setting)
    {
        $database = new Database($setting);
        $database->setMaster($this);
        $this->_slaves[] = $database;
    }
935974
public function addSettings( $settings )
    {
        $this->settings = ArrayUtils::merge(
            $this->settings,
            ArrayUtils::iteratorToArray( $settings )
        );

        return $this;
    }