Initialize method

@param array $config The configuration for the Table.
@return void
506076
public function initialize(array $config)
    {
        parent::initialize($config);

        $this->setTable('calendar_events');
        $this->setDisplayField('title');
        $this->setPrimaryKey('id');

        $this->addBehavior('Timestamp');
        $this->addBehavior('Muffin/Trash.Trash');

        $this->belongsTo('Calendars', [
            'foreignKey' => 'calendar_id',
            'joinType' => 'INNER',
            'className' => 'Qobo/Calendar.Calendars'
        ]);

        $this->belongsToMany('CalendarAttendees', [
            'joinTable' => 'events_attendees',
            'foreignKey' => 'calendar_event_id',
        ]);

        /** @var \Qobo\Calendar\Model\Table\CalendarsTable $table */
        $table = TableRegistry::get('Qobo/Calendar.Calendars');
        $this->Calendars = $table;
    }
287586
protected function initialize(array $config)
    {
        $this->swooleServer = $this->createSwooleServer($config);

        $this->configureDefaultServerSocket();

        $this->setOptions($config['options'] ?? []);

        $this->registerEventCallbacks($this->serverEvents);

        $this->events->dispatch(new Events\ServerCreated($this));
    }
496787
public function initialize(array $config) {
        parent::initialize($config);

        // set request
        $this->ctrl = $this->getController();
        $this->cookies = (new CookieCollection())->createFromServerRequest($this->ctrl->getRequest());
    }
249758
public function initialize(array $config = []) {
		$config = $this->_config;

		if (empty($config['bits'])) {
			$config['bits'] = Inflector::variable(Inflector::pluralize($config['field']));
		}

		$entity = $this->_table->newEntity();

		if (is_callable($config['bits'])) {
			$config['bits'] = call_user_func($config['bits']);
		} elseif (is_string($config['bits']) && method_exists($entity, $config['bits'])) {
			$method = $config['bits'];
			$config['bits'] = version_compare(PHP_VERSION, '7.0', '<') ? $entity->$method() : $entity::$method();
		} elseif (is_string($config['bits']) && method_exists($this->_table, $config['bits'])) {
			$table = $this->_table;
			$method = $config['bits'];
			$config['bits'] = version_compare(PHP_VERSION, '7.0', '<') ? $table->$method() : $table::$method();
		} elseif (!is_array($config['bits'])) {
			$config['bits'] = false;
		}
		if (empty($config['bits'])) {
			$method = Inflector::variable(Inflector::pluralize($config['field'])) . '()';
			throw new RuntimeException('Bits not found for field ' . $config['field'] . ', expected pluralized static method ' . $method . ' on the entity.');
		}
		ksort($config['bits'], SORT_NUMERIC);

		$this->_config = $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;
    }
769882
public function initialize(array $config): void
    {
        $this->table('model_history');
        $this->displayField('id');
        $this->primaryKey('id');
        $this->addBehavior('Timestamp');
        $this->belongsTo('Users', [
            'foreignKey' => 'user_id'
        ]);
        $this->schema()->columnType('data', 'json');
        $this->schema()->columnType('context', 'json');
    }
197528
public function initialize(array $config)
    {
        parent::initialize($config);

        $this->dir     = Configure::read('Cms.docDir');
        $this->locale  = Configure::read('App.defaultLocale');
        $this->charset = Str::low(Configure::read('App.encoding'));
        $this->eol     = (Configure::read('debug')) ? PHP_EOL : '';
        $this->tab     = (Configure::read('debug')) ? Configure::read('Cms.lineTab') : '';
    }
1351455
public function initialize(array $config)
    {
        $this->table('cms_pages');

        $this->hasOne('Collections', [
            'className' => 'Wasabi/Cms.Collections',
            'dependent' => true
        ]);

        $this->hasMany('Contents', [
            'className' => 'Wasabi/Cms.Contents',
            'foreignKey' => 'page_id',
            'dependent' => true
        ]);

        $this->hasMany('Current', [
            'className' => 'Wasabi/Cms.Contents',
            'foreignKey' => 'page_id',
            'finder' => 'Current'
        ]);

        $this->hasMany('Attributes', [
            'className' => 'Wasabi/Cms.Attributes',
            'foreignKey' => 'foreign_key',
            'conditions' => [
                'model' => 'Wasabi/Cms.Pages',
                'language_id' => Wasabi::contentLanguage()->id
            ],
            'dependent' => true
        ]);

        $this->hasMany('Routes', [
            'className' => 'Wasabi/Core.Routes',
            'foreignKey' => 'foreign_key',
            'conditions' => [
                'model' => 'Wasabi/Cms.Pages'
            ],
            'dependent' => true
        ]);

        $this->addBehavior('Translate', self::$translateOptions);

        $this->addBehavior('Tree');
        $this->addBehavior('Timestamp');

        $this->locale(Wasabi::contentLanguage()->iso2);
    }
982815
private function applyConfig(array $config): void
    {
        // override
        if ($this->config != null) {
            $config = Config::merge($config, $this->config->getData());
        }
        $this->config = new Config($config);

        // set/reset logger options
        $loggerOptions = $this->config->get('logger');
        if ($loggerOptions != null) {
            isset($loggerOptions['level']) && $this->logger->setLevel($loggerOptions['level']);
            isset($loggerOptions['directory']) && $this->logger->setDirectory($loggerOptions['directory']);
        }
    }
1096922
public function initialize(array $config)
    {
        parent::initialize($config);

        $this->table('alt3_cake_tokens');
        $this->displayField('id');
        $this->primaryKey('id');

        $this->removeBehavior('Timestamp');
    }
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;
        }
    }
1235928
public function initialize(array $config)
    {
        $controller = $this->_registry->getController();
        $this->setEventManager($controller->getEventManager());
        $this->response =& $controller->response;
        $this->session = $controller->getRequest()->getSession();

        if ($this->getConfig('ajaxLogin')) {
            deprecationWarning(
                'The `ajaxLogin` option is deprecated. Your client-side ' .
                'code should instead check for 403 status code and show ' .
                'appropriate login form.'
            );
        }
    }
528742
public function initialize(array $config) {
        $this->config = $config;
        $this->controller = $this->_registry->getController();
        $registry = new ComponentRegistry();
        $this->Acl = new AclComponent($registry, Configure::read('Acl'));
        $this->Aco = $this->Acl->Aco;
        $this->Aro = $this->Acl->Aro;
        return null;
    }
658474
public function initialize(array $config)
    {
        parent::initialize($config);

        if (Plugin::getCollection()->has('Assets')) {
            $this->Asset = $this->getView()->loadHelper('Assets.Asset');
        } else {
            $this->Asset = clone $this->Html;
        }
    }
1082635
public function initialize(array $config)
    {
        $table = Configure::check('CakephpBlueimpUpload.upload_table') ? Configure::read('CakephpBlueimpUpload.upload_table') : 'uploads';

        $this->setTable($table);
        $this->setDisplayField('id');
        $this->setPrimaryKey('id');
        $this->addBehavior('Timestamp');
        $this->addBehavior('Alaxos.UserLink');
    }
706636
public function init( $config = [ ] )
    {
        $this->initDefaults();

        $this->initMail( $config );

        $this->initLog( $config );

        $this->initDatabase( $config );

        $this->initRequest( $config );

        $this->initRouter( $config );

        $this->initSession( $config );

        $this->initAppName( $config );

        $this->initDefaultLanguage( $config );

//        $this->_initMaintenanceMode( $config );
    }
1243221
public function setConfig(&$config)
    {
        $this->_checkConfig($config);

        $this->config = $config;
        $this->init();
    }