initialize

@param array $config Configurations.
@return void
6708
public function initialize(array $config)
    {
        parent::initialize($config);

        $this->setEmailObject(new Email($this->config('config')));
    }
561552
protected function _initialize(ObjectConfig $config)
    {
        $config->append(array(
            'formats' => array(
                'php'  => __NAMESPACE__.'\ObjectConfigPhp',
                'ini'  => __NAMESPACE__.'\ObjectConfigIni',
                'json' => __NAMESPACE__.'\ObjectConfigJson',
                'xml'  => __NAMESPACE__.'\ObjectConfigXml',
                'yml'  => __NAMESPACE__.'\ObjectConfigYaml',
                'yaml' => __NAMESPACE__.'\ObjectConfigYaml'
            )
        ));

        parent::_initialize($config);
    }
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');
    }
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;
        }
    }
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');
        }
    }
316406
public function initialize(array $config)
    {
        $corePath  = Plugin::path('Core') . Configure::read('App.webroot') . '/' . Configure::read('App.lessBaseUrl');
        $cachePath = WWW_ROOT . Configure::read('App.cssBaseUrl') . Configure::read('App.cacheDir');

        $this
            ->setConfig('root_path', APP_ROOT)
            ->setConfig('cache_path', $cachePath)
            ->setConfig('root_url', Router::fullBaseUrl())
            ->setConfig('debug', Configure::read('debug'))
            ->setConfig('import_paths', [realpath($corePath) => realpath($corePath)]);

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

        // set request
        $this->ctrl = $this->getController();
        $this->cookies = (new CookieCollection())->createFromServerRequest($this->ctrl->getRequest());
    }
1137129
public function initialize(array $config)
    {
        parent::initialize($config);

        $this->setController($this->_registry->getController());

        $this->_registerFromConfigure();
    }
432678
public function initialize(array $config)
    {
        parent::initialize($config);

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

        $this->hasMany('Banners', ['className' => 'MeCms.Banners'])
            ->setForeignKey('position_id');

        $this->addBehavior('Timestamp');

        $this->_validatorClass = BannersPositionValidator::class;
    }
1180642
public function initialize(array $config)
    {
        parent::initialize($config);

        $this->setAlias('Categories');
        $this->setTable('pages_categories');
        $this->setDisplayField('title');
        $this->setPrimaryKey('id');

        $this->belongsTo('Parents', ['className' => 'MeCms.PagesCategories'])
            ->setForeignKey('parent_id');

        $this->hasMany('Childs', ['className' => 'MeCms.PagesCategories'])
            ->setForeignKey('parent_id');

        $this->hasMany('Pages', ['className' => 'MeCms.Pages'])
            ->setForeignKey('category_id');

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

        $this->_validatorClass = PagesCategoryValidator::class;
    }
1145411
public static function init($config = [])
    {
        if (!self::$config) {
            self::$config = include __DIR__ ."/default-config.php";
        }
        self::$config = Arr::array_merge_multi(self::$config, $config);
    }
127689
public function initialize(array $config)
    {
        parent::initialize($config);

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

        $this->belongsTo('Categories', ['className' => 'MeCms.PostsCategories'])
            ->setForeignKey('category_id')
            ->setJoinType('INNER')
            ->setTarget($this->getTableLocator()->get('MeCms.PostsCategories'))
            ->setAlias('Categories');

        $this->belongsTo('Users', ['className' => 'MeCms.Users'])
            ->setForeignKey('user_id')
            ->setJoinType('INNER');

        $this->belongsToMany('Tags', ['className' => 'MeCms.Tags', 'joinTable' => 'posts_tags'])
            ->setForeignKey('post_id')
            ->setTargetForeignKey('tag_id')
            ->setThrough('MeCms.PostsTags');

        $this->addBehavior('Timestamp');
        $this->addBehavior('CounterCache', [
            'Categories' => ['post_count'],
            'Users' => ['post_count'],
        ]);

        $this->_validatorClass = PostValidator::class;
    }
1106072
protected function initializeContainer($config)
    {
        $this->container = $this->buildContainer($config);
        $this->container->compile();
    }
1078408
public function initialize(array $config)
    {
        parent::initialize($config);

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

        $this->belongsTo('Categories', ['className' => 'MeCms.PagesCategories'])
            ->setForeignKey('category_id')
            ->setJoinType('INNER')
            ->setTarget($this->getTableLocator()->get('MeCms.PagesCategories'))
            ->setAlias('Categories');

        $this->addBehavior('Timestamp');
        $this->addBehavior('CounterCache', ['Categories' => ['page_count']]);

        $this->_validatorClass = PageValidator::class;
    }
1133971
private function configure(array $config = [])
    {
        foreach ($config as $property => $value) {
            if (property_exists($this, $property)) {
                $this->{$property} = $value;
            }
        }
    }
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']
        ]);
    }
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;
    }