common/services/entities/ThemeService.php
public function makeDefault( Theme $model, $config = [] ) {

		$modelClass	= static::$modelClass;

		$type = CoreGlobal::TYPE_SITE;

		if( $model->type !== $type ) {

			return false;
		}

		// Disable All
		$modelClass::updateAll( [ 'default' => false ], "`default`=1 AND `type`='$type'" );

		// Make Default
		$model->default = true;

		// Update
		return parent::update( $model, [
			'attributes' => [ 'default' ]
		]);
	}
public function makeDefault( Theme $model, $config = [] ) {

		$modelClass	= static::$modelClass;

		$type = CoreGlobal::TYPE_SITE;

		if( $model->type !== $type ) {

			return false;
		}

		// Disable All
		$modelClass::updateAll( [ 'default' => false ], "`default`=1 AND `type`='$type'" );

		// Make Default
		$model->default = true;

		// Update
		return parent::update( $model, [
			'attributes' => [ 'default' ]
		]);
	}
public function makeDefault ( Theme $ model , $ config = [ ] ) { $ modelClass = static :: $ modelClass ; $ type = CoreGlobal :: TYPE_SITE ; if ( $ model -> type !== $ type ) { return false ; } // Disable All $ modelClass :: updateAll ( [ 'default' => false ] , "`default`=1 AND `type`='$type'" ) ; // Make Default $ model -> default = true ; // Update return parent :: update ( $ model , [ 'attributes' => [ 'default' ] ] ) ; }
Make the default theme available for all sites in case no theme is selected.

@param type $model
@param type $config
@return type
Make the default theme available for all sites in case no theme is selected .