public function config($config = [])
    {
        $defaults = [
            'conventions' => [
                'source' => function($class) {
                    $basename = substr(strrchr($class, '\\'), 1);
                    return Inflector::underscore($basename);
                },
                'key' => function() {
                    return 'id';
                },
                'reference' => function($class) {
                    $pos = strrpos($class, '\\');
                    $basename = substr($class, $pos !== false ? $pos + 1 : 0);
                    return Inflector::underscore(Inflector::singularize($basename)). '_id';
                },
                'references' => function($class) {
                    $pos = strrpos($class, '\\');
                    $basename = substr($class, $pos !== false ? $pos + 1 : 0);
                    return Inflector::underscore(Inflector::singularize($basename)). '_ids';
                },
                'field' => function($class) {
                    $pos = strrpos($class, '\\');
                    $basename = substr($class, $pos !== false ? $pos + 1 : 0);
                    return Inflector::underscore(Inflector::singularize($basename));
                },
                'multiple' => function($name) {
                    return Inflector::pluralize($name);
                },
                'single' => function($name) {
                    return Inflector::singularize($name);
                }
            ]
        ];
        $config = Set::extend($defaults, $config);
        $this->_conventions = $config['conventions'];
    }
public function config($config = [])
    {
        $defaults = [
            'conventions' => [
                'source' => function($class) {
                    $basename = substr(strrchr($class, '\\'), 1);
                    return Inflector::underscore($basename);
                },
                'key' => function() {
                    return 'id';
                },
                'reference' => function($class) {
                    $pos = strrpos($class, '\\');
                    $basename = substr($class, $pos !== false ? $pos + 1 : 0);
                    return Inflector::underscore(Inflector::singularize($basename)). '_id';
                },
                'references' => function($class) {
                    $pos = strrpos($class, '\\');
                    $basename = substr($class, $pos !== false ? $pos + 1 : 0);
                    return Inflector::underscore(Inflector::singularize($basename)). '_ids';
                },
                'field' => function($class) {
                    $pos = strrpos($class, '\\');
                    $basename = substr($class, $pos !== false ? $pos + 1 : 0);
                    return Inflector::underscore(Inflector::singularize($basename));
                },
                'multiple' => function($name) {
                    return Inflector::pluralize($name);
                },
                'single' => function($name) {
                    return Inflector::singularize($name);
                }
            ]
        ];
        $config = Set::extend($defaults, $config);
        $this->_conventions = $config['conventions'];
    }
public function config ( $ config = [ ] ) { $ defaults = [ 'conventions' => [ 'source' => function ( $ class ) { $ basename = substr ( strrchr ( $ class , '\\' ) , 1 ) ; return Inflector :: underscore ( $ basename ) ; } , 'key' => function ( ) { return 'id' ; } , 'reference' => function ( $ class ) { $ pos = strrpos ( $ class , '\\' ) ; $ basename = substr ( $ class , $ pos !== false ? $ pos + 1 : 0 ) ; return Inflector :: underscore ( Inflector :: singularize ( $ basename ) ) . '_id' ; } , 'references' => function ( $ class ) { $ pos = strrpos ( $ class , '\\' ) ; $ basename = substr ( $ class , $ pos !== false ? $ pos + 1 : 0 ) ; return Inflector :: underscore ( Inflector :: singularize ( $ basename ) ) . '_ids' ; } , 'field' => function ( $ class ) { $ pos = strrpos ( $ class , '\\' ) ; $ basename = substr ( $ class , $ pos !== false ? $ pos + 1 : 0 ) ; return Inflector :: underscore ( Inflector :: singularize ( $ basename ) ) ; } , 'multiple' => function ( $ name ) { return Inflector :: pluralize ( $ name ) ; } , 'single' => function ( $ name ) { return Inflector :: singularize ( $ name ) ; } ] ] ; $ config = Set :: extend ( $ defaults , $ config ) ; $ this -> _conventions = $ config [ 'conventions' ] ; }
Configures the schema class.

@param array $config Possible options are:
- `'conventions'` _array_: Allow to override the default convention rules for generating
primary or foreign key as well as for table/collection names
from an entity class name.
Configures the schema class .