src/BaseCollection.php
public static function register($id, $options)
    {
        $id = (string)$id;
        if (self::exists($id)) {
            user_error(Text::insert('A collection with id ":id" is already registered.', ['id' => $id]));
            return;
        }
        $defaults = [
            'model' => 'Plugin.Model',
            'displayName' => 'Translated Name'
        ];
        $options = array_merge($defaults, $options);
        self::_instance()->_items[$id] = $options;
    }
public static function register($id, $options)
    {
        $id = (string)$id;
        if (self::exists($id)) {
            user_error(Text::insert('A collection with id ":id" is already registered.', ['id' => $id]));
            return;
        }
        $defaults = [
            'model' => 'Plugin.Model',
            'displayName' => 'Translated Name'
        ];
        $options = array_merge($defaults, $options);
        self::_instance()->_items[$id] = $options;
    }
public static function register ( $ id , $ options ) { $ id = ( string ) $ id ; if ( self :: exists ( $ id ) ) { user_error ( Text :: insert ( 'A collection with id ":id" is already registered.' , [ 'id' => $ id ] ) ) ; return ; } $ defaults = [ 'model' => 'Plugin.Model' , 'displayName' => 'Translated Name' ] ; $ options = array_merge ( $ defaults , $ options ) ; self :: _instance ( ) -> _items [ $ id ] = $ options ; }
Register a new collection.

@param string $id The collection identifier.
@param array $options The collection options.
Register a new collection .