Initializes the options for the object

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

@param   KObjectConfig $config Configuration options
@return  void
435367
protected function _initialize(KObjectConfig $config)
    {
        $path       = rtrim($this->getObject('request')->getSiteUrl()->getPath(), '/');
        $nooku_path = $path.'/media/koowa/framework';
        $schemes    = array(
            'assets://js'  => $nooku_path.'/js',
            'assets://css' => $nooku_path.'/css',
            'assets://img' => $nooku_path.'/img',
            'assets://koowa' => $path.'/media/koowa/com_koowa',
            'media://'     => $path.'/media/',
            'root://'      => $path.'/',
            'base://'      => rtrim($this->getObject('request')->getBaseUrl()->getPath(), '/').'/'
        );

        if (empty(static::$_component_assets))
        {
            $components = $this->getObject('object.bootstrapper')->getComponents();

            foreach($components as $component)
            {
                $identifier = $this->getIdentifier($component);

                // Only register reusable components such as files and koowa
                if ($identifier->domain === 'koowa')
                {
                    $key         = 'assets://'.$identifier->package;
                    $destination = $path.'/media/koowa/com_'.$identifier->package;

                    static::$_component_assets[$key] = $destination;
                }
            }
        }

        $schemes = array_merge($schemes, static::$_component_assets);

        // Override default scheme with the media/ folder
        $schemes['assets://'] = $path.'/media/';

        $config->append(array(
            'schemes' => $schemes,
        ));

        parent::_initialize($config);
    }
493024
private function init($config = array())
    {
        $this->getCore()->open($this->getFilename(), $config);
        if ($this->currentSheet !== null) {
            $this->getCore()->setSheet($this->currentSheet);
        }
    }
1326055
public function init( $config = NULL )
    {
        $option                   = new Option();
        $option->shortCode        = 'h';
        $option->longCode         = 'help';
        $option->isOptional       = TRUE;
        $option->type             = Type::BOOLEAN;
        $option->shortDescription = 'Show the help menu';

        $this->options[ ] = $option;

        $option                   = new Option();
        $option->shortCode        = 'v';
        $option->longCode         = 'verbose';
        $option->isOptional       = TRUE;
        $option->type             = Type::BOOLEAN;
        $option->shortDescription = 'Show detailed log';

        $this->options[ ] = $option;
    }
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);
    }
672065
protected function _initialize(KObjectConfig $config)
    {
        $config->append(array(
            'base_url'  => '/',
            'base_path' => null,
            'url'       => null,
            'method'   => null,
            'query'   => $_GET,
            'data'    => $_POST,
            'cookies' => $_COOKIE,
            'files'   => $_FILES,
            'proxies' => array(),
            'format'  => null,
        ));

        parent::_initialize($config);
    }
1064747
protected function _initialize(ObjectConfig $config)
    {
        $config->append(array(
            'users' => array($this->getObject('user')),
        ));

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

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

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

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

        if (Plugin::loaded('Search')) {
            $this->addBehavior('Search.Search');
        }
    }
255981
protected function _initialize(ObjectConfig $config)
    {
        $config->append(array(
            'method'  => self::GET,
            'url'     => '',
            'headers' => array()
        ));

        parent::_initialize($config);
    }
993148
protected function _initialize(ObjectConfig $config)
    {
        $config->append(array(
            'data'             => array(),
            'parameters'       => array(),
            'model'      => 'lib:model.empty',
            'content'    => '',
            'url'        =>  $this->getObject('lib:http.url'),
            'title'      => ucfirst($this->getName()),
            'behaviors'  => array('lib:behavior.eventable')
        ));

        parent::_initialize($config);
    }
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',
                ]
            ]
        ]);
    }
1166338
protected function _initialize(ObjectConfig $config)
    {
        $config->append(array(
            'cookie_name' => 'referrer',
            'cookie_path' => $this->getObject('request')->getBaseUrl()->toString(HttpUrl::PATH)
        ));

        parent::_initialize($config);
    }
1319511
protected function _initialize(KObjectConfig $config)
    {
        $config->append(array(
            'data'         => null,
            'identity_key' => null,
            'prototypable' => true
        ));

        parent::_initialize($config);
    }
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'
        ]);
    }
6708
public function initialize(array $config)
    {
        parent::initialize($config);

        $this->setEmailObject(new Email($this->config('config')));
    }
790471
public function initialize(array $config)
    {
        parent::initialize($config);

        $this->setTable('tokens');
        $this->setDisplayField('token');
        $this->setPrimaryKey('id');

        $usersClass = empty($config['usersClassOptions']) ? Configure::read('Tokens.usersClassOptions') : $config['usersClassOptions'];
        if ($usersClass) {
            $this->belongsTo('Users', $usersClass);

            if (!$this->Users->hasAssociation('tokens')) {
                $this->Users->hasMany('Tokens')->setForeignKey('user_id');
            }
        }
    }
845441
protected function _initialize(KObjectConfig $config)
    {
        $config->append(array(
            'lifetime'   =>  JFactory::getSession()->getExpire()
        ));

        parent::_initialize($config);
    }