src/Common/Model/BaseComponent.php
public function saveEnabled($mSlug)
    {
        $oAppSettingService = Factory::service('AppSetting');

        if ($this->bEnableMultiple) {

            $mSlug = (array) $mSlug;
            $mSlug = array_filter($mSlug);
            $mSlug = array_unique($mSlug);

        } else {

            $mSlug = trim($mSlug);
        }

        $aSetting = [
            $this->sEnabledSetting => $mSlug,
        ];

        if (!$oAppSettingService->set($aSetting, $this->sModule)) {
            throw new NailsException($oAppSettingService->lastError(), 1);
        }

        return $this;
    }
public function saveEnabled($mSlug)
    {
        $oAppSettingService = Factory::service('AppSetting');

        if ($this->bEnableMultiple) {

            $mSlug = (array) $mSlug;
            $mSlug = array_filter($mSlug);
            $mSlug = array_unique($mSlug);

        } else {

            $mSlug = trim($mSlug);
        }

        $aSetting = [
            $this->sEnabledSetting => $mSlug,
        ];

        if (!$oAppSettingService->set($aSetting, $this->sModule)) {
            throw new NailsException($oAppSettingService->lastError(), 1);
        }

        return $this;
    }
public function saveEnabled ( $ mSlug ) { $ oAppSettingService = Factory :: service ( 'AppSetting' ) ; if ( $ this -> bEnableMultiple ) { $ mSlug = ( array ) $ mSlug ; $ mSlug = array_filter ( $ mSlug ) ; $ mSlug = array_unique ( $ mSlug ) ; } else { $ mSlug = trim ( $ mSlug ) ; } $ aSetting = [ $ this -> sEnabledSetting => $ mSlug , ] ; if ( ! $ oAppSettingService -> set ( $ aSetting , $ this -> sModule ) ) { throw new NailsException ( $ oAppSettingService -> lastError ( ) , 1 ) ; } return $ this ; }
Save which components are enabled

@param array|string $mSlug The slug to set as enabled, or array of slugs if bEnableMultiple is true

@throws NailsException
@return $this
Save which components are enabled