Classes/Lightwerk/SurfCaptain/Domain/Repository/Preset/AbstractRepository.php
public function add($identifier, array $configuration)
    {
        $presets = $this->loadPresets();
        if (!empty($presets[$identifier])) {
            throw new Exception('Preset exists already', 1410552459);
        }
        if (empty($configuration)) {
            throw new Exception('Empty configuration is not allowed', 1410595656);
        }
        $presets[$identifier] = $configuration;
        ksort($presets);
        $this->savePresets($presets, 'Adds preset with identifier "' . $identifier . '"');
    }
public function add($identifier, array $configuration)
    {
        $presets = $this->loadPresets();
        if (!empty($presets[$identifier])) {
            throw new Exception('Preset exists already', 1410552459);
        }
        if (empty($configuration)) {
            throw new Exception('Empty configuration is not allowed', 1410595656);
        }
        $presets[$identifier] = $configuration;
        ksort($presets);
        $this->savePresets($presets, 'Adds preset with identifier "' . $identifier . '"');
    }
public function add ( $ identifier , array $ configuration ) { $ presets = $ this -> loadPresets ( ) ; if ( ! empty ( $ presets [ $ identifier ] ) ) { throw new Exception ( 'Preset exists already' , 1410552459 ) ; } if ( empty ( $ configuration ) ) { throw new Exception ( 'Empty configuration is not allowed' , 1410595656 ) ; } $ presets [ $ identifier ] = $ configuration ; ksort ( $ presets ) ; $ this -> savePresets ( $ presets , 'Adds preset with identifier "' . $ identifier . '"' ) ; }
Adds a preset to this repository.

@param string $identifier
@param array $configuration
@return void
@throws Exception
Adds a preset to this repository .