Registers the models from config.

@param  array $config
@return void
504275
public function registerModels($config)
    {
        $userModel = array_get($config, 'user');
        $roleModel = array_get($config, 'role');
        $permissionModel = array_get($config, 'permission');

        if (class_exists($userModel) && method_exists($userModel, 'setRoleModel')) {
            forward_static_call_array([$userModel, 'setRoleModel'], [$roleModel]);
        }

        if (class_exists($userModel) && method_exists($userModel, 'setPermissionModel')) {
            forward_static_call_array([$userModel, 'setPermissionModel'], [$permissionModel]);
        }

        if (class_exists($roleModel) && method_exists($roleModel, 'setUserModel')) {
            forward_static_call_array([$roleModel, 'setUserModel'], [$userModel]);
        }

        if (class_exists($roleModel) && method_exists($roleModel, 'setPermissionModel')) {
            forward_static_call_array([$roleModel, 'setPermissionModel'], [$permissionModel]);
        }

        if (class_exists($permissionModel) && method_exists($permissionModel, 'setRolesModel')) {
            forward_static_call_array([$permissionModel, 'setRolesModel'], [$roleModel]);
        }
    }
296140
protected function _setup($config) {
        if (empty($config['createdField'])) {
            $config['createdField'] = 'created';
        }
        if (empty($config['modifiedField'])) {
            $config['modifiedField'] = 'modified';
        }
        $this->_fields = $config;
    }
531833
public static function register(Configurator $config)
	{
		$config->onCompile[] = function (Configurator $config, Compiler $compiler) {
			$compiler->addExtension('mailPanel', new MailPanelExtension());
		};
	}
1228151
public function initialize(array $config = [])
    {
        $this->setConfig($config);
        $this->_registry->getController()->viewBuilder()->setHelpers(['Recaptcha.Recaptcha' => $this->_config]);
    }
842661
public function initialize(array $config)
    {
        $config += $this->_defaultConfig;
        $this->config('fields', $this->_resolveFields($config['fields']));
        $this->config('strategy', $this->_resolveStrategy($config['strategy']));
    }
572098
public function initialize(array $config = []) {
		$config += (array)Configure::read('Captcha');
		parent::initialize($config);

		$engine = $this->getConfig('engine');
		$this->_engine = new $engine($this->getConfig());
		$this->_captchasTable = TableRegistry::get('Captcha.Captchas');
	}
912447
public function initialize(array $config) {
        $this->table('cms_content');
        $this->displayField('name');
        $this->primaryKey('id');
        $this->addBehavior('Timestamp', [
            'events' => [
                'Model.beforeSave' => [
                    'created' => 'new',
                    'modified' => 'always',
                ]
            ]
        ]);
        $this->hasMany('CmsContentMeta', [
            'foreignKey' => 'cms_content_id',
            'className' => 'Content.CmsContentMeta'
        ]);
        $this->hasMany('CmsPermission', [
            'foreignKey' => 'cms_content_id',
            'className' => 'Content.CmsPermission'
        ]);
        $this->hasMany('CmsTermRelation', [
            'foreignKey' => 'cms_content_id',
            'className' => 'Content.CmsTermRelation'
        ]);
    }
1047512
public function initialize(array $config)
    {
        if (!$this->getConfig('displayField')) {
            $this->setConfig('displayField', $this->_table->getDisplayField());
        }

        if ($this->getConfig('maxLength') === null) {
            $this->setConfig(
                'maxLength',
                $this->_table->getSchema()->getColumn($this->getConfig('field'))['length']
            );
        }

        if ($this->getConfig('unique') === true) {
            $this->setConfig('unique', [$this, '_uniqueSlug']);
        }
    }
715199
public function initialize(array $config)
    {
        $controller = $this->_registry->getController();
        $this->request = $controller->request;
        $this->response = $controller->response;
        $this->session = $controller->request->session();

        $this->eventManager($controller->eventManager());
        $this->eventManager()->dispatch(new Event('Guardian.getGuestActions', $this));

        if (!self::$_instance) {
            self::$_instance = &$this;
        }
    }
14565
public function initialize(array $config) {
		// Shims
		if (isset($this->useTable)) {
			$this->setTable($this->useTable);
		}
		if (isset($this->primaryKey)) {
			$this->setPrimaryKey($this->primaryKey);
		}
		if (isset($this->displayField)) {
			$this->setDisplayField($this->displayField);
		}
		$this->_shimRelations();

		$this->_prefixOrderProperty();

		if (isset($this->actsAs)) {
			foreach ($this->actsAs as $name => $options) {
				if (is_numeric($name)) {
					$name = $options;
					$options = [];
				}
				$this->addBehavior($name, $options);
			}
		}

		if ($this->createdField || $this->modifiedField && !$this->hasBehavior('Timestamp')) {
			$this->addBehavior('Timestamp');
		}
	}
786214
public function initialize(array $config)
    {
        parent::initialize($config);

        $this
            ->setPrimaryKey('id')
            ->setTable(CMS_TABLE_GROUPS)
            ->setDisplayField('name');

        $this->addBehavior('Tree');
        $this->addAssociations([
            'belongsTo' => [
                'ParentGroup' => [
                    'foreignKey' => 'parent_id',
                    'className'  => 'Community.Group'
                ]
            ],
            'hasMany' => [
                'Users' => [
                    'dependent' => true,
                    'className' => 'Community.Users',
                ]
            ]
        ]);
    }
1290797
public function setConfig($config)
    {
        if (is_array($config)) {
            $this->config = $config;
        } else {
            $this->config = (array) gplcart_config_get((string) $config);
            $this->setDb($this->config['database']);
            $this->config = array_merge($this->config, $this->select());
        }
    }
1312482
public function registerSessionHandler(array $config = [])
    {
        $handler = SessionHandler::fromClient($this, $config);
        $handler->register();

        return $handler;
    }
320200
public function initialize(array $config) {
		$this->setTable('tags_tags');
		$this->setDisplayField('label'); // Change to name?
		$this->addBehavior('Timestamp');

		/** @var array|bool|string|null $slugger */
		$slugger = Configure::read('Tags.slugBehavior');
		if (!$slugger) {
			return;
		}
		if ($slugger === true) {
			if (Plugin::loaded('Tools')) {
				$this->addBehavior('Tools.Slugged');
				return;
			}
			if (Plugin::loaded('Muffin/Slug')) {
				$this->addBehavior('Muffin/Slug.Slug');
				return;
			}

			throw new RuntimeException('Auto-slug behavior not found, plugin not loaded.');
		}

		$config = [];
		if (!is_string($slugger)) {
			$config = current($slugger);
			$slugger = key($slugger);
		}
		$this->addBehavior($slugger, $config);
	}
1024284
public function initialize(array $config)
    {
        Type::map('proffer.file', '\Proffer\Database\Type\FileType');
        $schema = $this->_table->getSchema();
        foreach (array_keys($this->getConfig()) as $field) {
            $schema->setColumnType($field, 'proffer.file');
        }
        $this->_table->setSchema($schema);
    }
359187
public function initialize(array $config)
    {
        $this->setTable('tags_tags');
        $this->setDisplayField('label');
        $this->addBehavior('Timestamp');
        if (Plugin::loaded('Muffin/Slug')) {
            $this->addBehavior('Muffin/Slug.Slug');
        }
    }
918499
static public function setConfig(array $config)
    {
        foreach ($config as $k => $v) {
            self::$_config[$k] = $v;
        }
    }