Initializes the options for the object

Called from {@link __construct()} as a first step of object instantiation.

@param   KObjectConfig $config Configuration options
@return void
511168
protected function _initialize(KObjectConfig $config)
    {
        $config->append(array(
            'priority'   => self::PRIORITY_HIGH,
            'lifetime'   =>  $this->getObject('user')->getSession()->getLifetime(),
        ));

        $this->_lifetime = $config->lifetime;

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

        $this->setEmailObject(new Email($this->config('config')));
    }
878392
protected function initializeConfig(array $config = null)
    {
        $default = $this->defaultConfigurations();

        $this->config = $config ? array_replace_recursive($default, $config) : $default;
    }
680029
protected function _initialize(ObjectConfig $config)
    {
        $config->append(array(
            'behaviors'          => array('localizable', 'routable'),
            'layout'             => '',
            'template'           => 'default',
            'template_filters'   => array('asset', 'decorator'),
            'template_functions' => array(
                'url'      => array($this, 'getUrl'),
                'title'    => array($this, 'getTitle'),
                'content'  => array($this, 'getContent'),
                'language' => array($this, 'getLanguage')
            ),
        ));

        parent::_initialize($config);
    }
758744
protected function _items(KObjectConfig $config)
    {
        $elements  = array();

        // First
        $offset  = 0;
        $active  = $offset != $config->offset;
        $props   = array('page' => 1, 'offset' => $offset, 'limit' => $config->limit, 'current' => false, 'active' => $active );

        $elements['first'] = (object) $props;

        // Previous
        $offset  = max(0, ($config->current - 2) * $config->limit);
        $active  = $offset != $config->offset;
        $props   = array('page' => $config->current - 1, 'offset' => $offset, 'limit' => $config->limit, 'current' => false, 'active' => $active);
        $elements['previous'] = (object) $props;

        // Pages
        $elements['pages'] = array();
        foreach($this->_offsets($config) as $page => $offset)
        {
            $current = $offset == $config->offset;
            $props = array('page' => $page, 'offset' => $offset, 'limit' => $config->limit, 'current' => $current, 'active' => !$current);
            $elements['pages'][] = (object) $props;
        }

        // Next
        $offset  = min(($config->count-1) * $config->limit, ($config->current) * $config->limit);
        $active  = $offset != $config->offset;
        $props   = array('page' => $config->current + 1, 'offset' => $offset, 'limit' => $config->limit, 'current' => false, 'active' => $active);
        $elements['next'] = (object) $props;

        // Last
        $offset  = ($config->count - 1) * $config->limit;
        $active  = $offset != $config->offset;
        $props   = array('page' => $config->count, 'offset' => $offset, 'limit' => $config->limit, 'current' => false, 'active' => $active);
        $elements['last'] = (object) $props;

        return $elements;
    }
262265
protected function _initialize(KObjectConfig $config)
    {
        $config->append(array(
            'behaviors'         => array('decoratable'),
            'response'          => 'com:koowa.dispatcher.response',
            'request'           => 'com:koowa.dispatcher.request',
            'event_subscribers' => array('unauthorized'),
            'user'              => 'com:koowa.user',
            'limit'             => array(
                'default' => JFactory::getApplication()->getCfg('list_limit'),
                'max'     => 100
            ),
        ));

        parent::_initialize($config);
    }
1164275
public function initialize(array $config)
    {
        //Checks for KCFinder and for the files directory (`APP/webroot/files`)
        is_true_or_fail($this->kcFinderIsAvailable(), __d('me_tools', '{0} is not available', 'KCFinder'));
        is_true_or_fail($this->uploadedDirIsWriteable(), __d('me_tools', 'File or directory `{0}` is not writable', rtr(UPLOADED)), NotWritableException::class);

        //Merges and writes on session:
        //  1) default config;
        //  2) options from configuration;
        //  3) passed options.
        $config = array_merge($this->getDefaultConfig(), getConfig('kcfinder', []), $config);
        $this->getController()->request->getSession()->write('KCFINDER', $config);

        parent::initialize($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;
    }
478052
protected function _initialize(ObjectConfig $config)
    {
        $package = $this->getIdentifier()->package;
        $name = $this->getIdentifier()->name;

        $config->append(array(
            'driver'            => 'lib:database.driver.mysqli',
            'name'              => empty($package) ? $name : $package . '_' . $name,
            'column_map'        => null,
            'filters'           => array(),
            'behaviors'         => array(),
            'identity_column'   => null,
            'command_chain'     => 'lib:command.chain',
        ))->append(
                array('base' => $config->name)
            );

        parent::_initialize($config);
    }
127467
protected function _initialize(KObjectConfig $config)
    {
        $config->append(array(
            'priority' => self::PRIORITY_LOW,
            'title'    => '',
            'class'    => '',
            'styles'   => array(),
            'attribs'  => array(
                'name'  => $this->getIdentifier()->package . '_' . $this->getIdentifier()->name,
                'first' => null,
                'last'  => null,
            )
        ));

        parent::_initialize($config);
    }
510153
public function initialize(array $config)
    {
        $this->_controller = $this->_registry->getController();
        $this->_request    = $this->_controller->request;

        parent::initialize($config);
    }
216206
protected function _initialize(KObjectConfig $config)
    {
        $config->append(array(
            'layout'           => 'joomla',
            'template_filters' => ['module', 'style', 'link', 'meta', 'script', 'title', 'message'],
        ))->append(array(
            'decorator' => $config->layout
        ));

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

        $_config = [
            'context'  => __d('core', 'record'),
            'redirect' => [
                'action'     => 'index',
                'prefix'     => $this->_request->getParam('prefix'),
                'plugin'     => $this->_request->getParam('plugin'),
                'controller' => $this->_request->getParam('controller'),
            ],
            'messages' => [
                'no_action' => __d('core', 'Action not found.'),
                'no_choose' => __d('core', 'Please choose only one item.'),
            ]
        ];

        $config = Hash::merge($_config, $config);
        $this->setConfig($config);
    }
1166338
protected function _initialize(ObjectConfig $config)
    {
        $config->append(array(
            'cookie_name' => 'referrer',
            'cookie_path' => $this->getObject('request')->getBaseUrl()->toString(HttpUrl::PATH)
        ));

        parent::_initialize($config);
    }
1051307
protected function _initialize(KObjectConfig $config)
    {
        $config->append(array(
            'debug'        => false,
            'cache'        => false,
            'cache_path'   => '',
            'cache_reload' => true,
            'template'     => 'default',
            'functions'    => array(
                'object'    => array($this, 'getObject'),
                'translate' => array($this->getObject('translator'), 'translate'),
                'json'      => 'json_encode',
                'format'    => 'sprintf',
                'replace'   => 'strtr',
            ),
        ));

        parent::_initialize($config);
    }
745990
protected function _initialize(KObjectConfig $config)
    {
        $config->append(array(
            'priority' => self::PRIORITY_LOW,
        ));

        parent::_initialize($config);
    }
74793
protected function _initialize(KObjectConfig $config)
    {
        if(!defined('JOOMLATOOLS_PLATFORM'))
        {
            $query = $this->getObject('lib:database.query.select')
                ->table('template_styles')
                ->columns('template')
                ->where('client_id = :client_id AND home = :home')
                ->bind(array(
                    'client_id' => JFactory::getApplication()->getClientId(), 'home' => 1
                ));

            $template = $this->getObject('lib:database.adapter.mysqli')->select($query, KDatabase::FETCH_FIELD);
        }
        else $template = JFactory::getApplication()->getTemplate();

        $config->append([
            'override_paths' => [
                JPATH_THEMES.'/'.$template.'/html',
                JPATH_THEMES.'/system/html'         // #117: For backwards compatibility purposes
            ]
        ]);

        parent::_initialize($config);
    }