Initialize the model by the configuration.

@param string $config
764461
public function ini($config)
    {
        $this->table = Config::get($config.'.table');

        $classSchema = Config::get($config.'.schema');
        $schema = new $classSchema();

        $attributes = collect(($schema)->getAttributes());

        $this->internalAttributes = new Bag();

        $this->iniFillable($attributes);
        $this->iniDates($attributes);
        $this->iniCasts($attributes);
    }
235760
public function initialize(array $config)
    {
        $this->table('attachments');
        $this->displayField('filename');
        $this->primaryKey('id');
        $this->addBehavior('Timestamp');

        $this->schema()->columnType('tags', 'json');
    }
6708
public function initialize(array $config)
    {
        parent::initialize($config);

        $this->setEmailObject(new Email($this->config('config')));
    }
1181358
public function initialize(array $config)
    {
        $this->Attachments = TableRegistry::get('Attachments.Attachments');

        // Dynamically attach the hasMany relationship
        $this->_table->hasMany('Attachments.Attachments', [
            'conditions' => [
                'Attachments.model' => $this->_table->registryAlias()
            ],
            'foreignKey' => 'foreign_key',
            'dependent' => true
        ]);

        $this->Attachments->belongsTo($this->_table->registryAlias(), [
            'conditions' => [
                'Attachments.model' => $this->_table->registryAlias()
            ],
            'foreignKey' => 'foreign_key'
        ]);

        parent::initialize($config);
    }
140640
public function initSession($config)
    {
        $sessionConfig = new SessionConfig();
        $sessionConfig->setOptions($config);
        $sessionManager = new SessionManager($sessionConfig);
        $sessionManager->start();
        Container::setDefaultManager($sessionManager);
    }
648411
protected function _initialize(AnConfig $config)
    {
        parent::_initialize($config);

        if ($config->request->view) {
            $config->controller = $config->request->view;
        }
    }
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']);
        }
    }
1010325
public function initialize(array $config)
    {
        $this->table('cms_menu_items');

        $this->belongsTo('Menus', [
            'className' => 'Wasabi/Cms.Menus'
        ]);

        $this->addBehavior('CounterCache', ['Menus' => ['menu_item_count']]);
        $this->addBehavior('Tree');
        $this->addBehavior('Timestamp');
    }
55624
protected function _initialize(ObjectConfig $config)
    {
        $config->append(array(
            'priority' => self::PRIORITY_LOWEST,
        ));

        parent::_initialize($config);
    }
1341986
public function initialize(array $config)
    {
        $this->hasMany('BlockRegions', [
            'className' => 'Block.BlockRegions',
            'foreignKey' => 'block_id',
            'dependent' => true,
            'propertyName' => 'region',
        ]);
        $this->hasMany('Copies', [
            'className' => 'Block.Blocks',
            'foreignKey' => 'copy_id',
            'dependent' => true,
            'propertyName' => 'copies',
            'cascadeCallbacks' => true,
        ]);
        $this->belongsToMany('User.Roles', [
            'className' => 'User.Roles',
            'foreignKey' => 'block_id',
            'joinTable' => 'blocks_roles',
            'dependent' => false,
            'propertyName' => 'roles',
        ]);

        $this->addBehavior('Serializable', [
            'columns' => ['locale', 'settings']
        ]);
    }
921765
public function init( $config = NULL )
    {
        $this->config = $config;

        if ( isset( $config[ 'debug' ] ) )
        {
            $this->debug = $config[ 'debug' ];
        }

        $this->log = $this->filter( self::ON_SET_LOG_FILTER, NULL );

        $this->doAction( self::ON_COMPONENT_INIT_ACTION );
    }
1095558
protected function _initialize(KObjectConfig $config)
    {
        $config->append(array(
            'method'  => self::GET,
            'url'     => '',
            'headers' => array()
        ));

        parent::_initialize($config);
    }
378447
public function initialize(array $config)
    {
        $configs = [];
        foreach ($config as $field => $settings) {
            if (is_int($field)) {
                $configs[$settings] = [];
            } else {
                $configs[$field] = $settings;
            }
        }

        $this->setConfig($configs);
        $this->setConfig('className', null);

        Type::map('upload.file', 'Josegonzalez\Upload\Database\Type\FileType');
        $schema = $this->_table->getSchema();
        foreach (array_keys($this->getConfig()) as $field) {
            $schema->setColumnType($field, 'upload.file');
        }
        $this->_table->setSchema($schema);
    }
728087
protected function _initialize(ObjectConfig $config)
    {
        $config->append(array(
            'charset'       => 'UTF-8',
            'table_prefix'  => null,
            'table_needle'  => null,
            'command_chain' => 'lib:command.chain',
            'connection'    => null,
            'auto_connect'  => false,
        ));

        parent::_initialize($config);
    }
636320
public function initialize(array $config)
    {
        parent::initialize($config);

        $this->_action = $this->_controller->request->getParam('action');
        $this->_request = $this->_controller->request;

        if (!isset($this->_controller->dispatchComponents)) {
            $this->_controller->dispatchComponents = [];
        }

        $this->_controller->dispatchComponents['Crud'] = true;
    }
1279170
protected function _initialize(ObjectConfig $config)
    {
        $config->append(array(
            'priority' => self::PRIORITY_LOW,
        ));

        parent::_initialize($config);
    }
1295443
public function initialize(array $config) {
		parent::initialize($config);

		$this->addBehavior('Timestamp');
		if (Configure::read('Queue.isSearchEnabled') !== false && Plugin::isLoaded('Search')) {
			$this->addBehavior('Search.Search');
		}

		$this->belongsTo('WorkerProcesses', [
			'className' => 'Queue.QueueProcesses',
			'foreignKey' => false,
			'conditions' => [
				'WorkerProcesses.workerkey = QueuedJobs.workerkey',
			],
		]);
	}