Initializes the options for the object.

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

@param 	object 	An optional AnConfig object with configuration options
504281
protected function _initialize(AnConfig $config)
    {
        $count = count($this->getIdentifier()->path);

        $config->append(array(
            'path' => '',
            'filename' => $this->getIdentifier()->path[$count - 1].'.'.$this->getIdentifier()->name,
            'disposition' => 'attachment',
        ));

        parent::_initialize($config);
    }
52762
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'priority' => AnCommand::PRIORITY_NORMAL,
        ));

        parent::_initialize($config);
    }
1004193
protected function _initialize(AnConfig $config)
    {
        //@todo not crazy about this approach, but there was no way
        //that I could obtain the locatable from the controller
        $locatable_id = AnRequest::get('get.locatable_id', 'int', 0);

        if(!$this->_locatable && $locatable_id)
        {
            $this->_locatable = AnService::get('repos:nodes.node')
            ->getQuery()
            ->id($locatable_id)
            ->fetch();
        }

        parent::_initialize($config);
    }
316511
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'layout' => 'list',
            'template_paths' => array(
                dirname(__FILE__).'/html',
                ANPATH_THEMES.'/'.$this->getService('application')->getTemplate().'/html/com_base/comment'
            ),
        ));

        parent::_initialize($config);
    }
1046724
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'relationships' => array(
                'locations' => array(
                    'through' => 'com:locations.domain.entity.tag',
                    'target' => $config->target ? $config->target : 'com:base.domain.entity.node',
                    'child_key' => 'tagable',
                    'target_child_key' => 'location',
                    'inverse' => true,
                ),
            )
        ));

        parent::_initialize($config);
    }
901424
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'list_item_view' => AnInflector::singularize($this->getIdentifier()->package),
            'template_paths' => array(
                dirname(__FILE__).'/html',
                ANPATH_THEMES.'/'.$this->getService('application')->getTemplate().'/html/com_actors/actors'
            ),
        ));

        parent::_initialize($config);
    }
587604
protected function _initialize(AnConfig $config)
    {
        $base_url = AnRequest::base();
        $settings = $this->getService('com:settings.setting');

        if (PHP_SAPI == 'cli' && $settings->live_site != '') {
            $scheme = is_ssl() ? 'https://' : 'http://';
            $base_url = $scheme.$settings->live_site;
        }

        $config->append(array(
            'base_url' => $base_url,
            'test_options' => array(
                'enabled' => get_config_value('mailer.debug', false),
                'email' => get_config_value('mailer.redirect_email'),
                'log' => $settings->tmp_path . '/emails/',
            ),
            'template_view' => null,
        ));

        parent::_initialize($config);
    }
714358
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'test_mode' => get_config_value('subscriptions.test_mode', true),
            'login' => get_config_value('subscriptions.login'),
            'password' => get_config_value('subscriptions.password'),
            'signature' => get_config_value('subscriptions.signature')
        ));

        parent::_initialize($config);
    }
1038884
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'resources' => array('subscriptions_packages'),
            'attributes' => array(
                'name' => array('required' => true),
                'body' => array('format' => 'html'),
                'price' => array(
                    'type' => 'float',
                    'required' => true,
                ),
                'duration' => array(
                    'type' => 'integer',
                    'required' => true,
                ),
                'recurring' => array(
                    'type' => 'integer',
                    'default' => 0,
                ),
                'billingPeriod' => array(
                    'default' => self::BILLING_PERIOD_YEAR,
                    'required' => true,
                ),
            ),
            'relationships' => array(
                //let the cleaner to take care of it
                'subscriptions' => array(
                    'parent_delete' => 'ignore',
                 ),
            ),
            'behaviors' => array(
                'authorizer',
                'orderable',
                'describable',
                'enableable',
                'dictionariable',
                'modifiable',
            ),
        ));

        parent::_initialize($config);
    }
423165
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'theme' => 'base'
        ));

        $config->append(array(
            'view' => 'tmpl:'.$config->theme.'.view.'.$this->getIdentifier()->name.'.'.$config->request->getFormat(),
        ));

        parent::_initialize($config);
    }
1198733
public function setConfig(AnConfig $config)
    {
        parent::setConfig($config);

        $this->_entityset = $config->entityset;
        $this->_cardinality = $config->cardinality;

        if (is_numeric($this->_cardinality)) {
            $this->_cardinality = (int) $this->_cardinality;
        }

        $this->_delete_rule = $config->parent_delete;
        $this->_child_key = $config->child_key;
    }
1139114
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
           'polymorphic' => true,
        ));

        $relationship['polymorphic'] = $config->polymorphic;

        //if parent is set, then set the base parent
        if (isset($config['parent'])) {
            if (strpos($config['parent'], '.') === false) {
                $identifier = clone $config->service_identifier;

                $identifier->path = array('domain','entity');

                $identifier->name = $config['parent'];
            } else {
                $identifier = $this->getService($config['parent']);
            }

            $relationship['parent'] = $identifier;

            unset($config['parent']);

            $config->append(array(
                'aliases' => array($identifier->name => 'parent'),
            ));
        }

        $config->append(array(
            'relationships' => array(
                'parent' => $relationship,
            ),
        ));

        parent::_initialize($config);
    }
375427
protected function _initialize(AnConfig $config)
    {
        $identifier = clone $this->getIdentifier();

        $identifier->path = array('domain','repository');

        register_default(array('identifier' => $identifier, 'prefix' => $this));

        $config->append(array(
            'attributes' => array(),
            'relationships' => array(),
            'repository' => $identifier,
            'entity_identifier' => $this->getIdentifier(),
        ));

        parent::_initialize($config);
    }
1133105
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'request' => array(
                'scope' => '',
                'sort' => 'trending',
                'days' => AnRequest::get('get.days', 'int', 7),
            ),
        ));

        parent::_initialize($config);

        $this->getService('anahita:language')->load('com_tags');
    }
884497
protected function _initialize(AnConfig $config)
    {
        $repoIdentifier = $config->mixer->getIdentifier()->identifier;
        $config->append(array(
            'relationships' => array(
                'mentions' => array(
                    'through' => 'com:people.domain.entity.mention',
                    'target' => str_replace('repository', 'entity', $repoIdentifier),
                    'child_key' => 'tagable',
                    'target_child_key' => 'mention',
                    'inverse' => true,
                ),
            ),
        ));

        parent::_initialize($config);
    }
606584
function initConfig(obj) {
  Object.keys(obj).forEach(item => {
    if (!process.env[item]) {
      process.env[item] = obj[item];
    }
  });
}
1318038
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'command_chain'     => null,
            'event_dispatcher'  => null,
            'dispatch_events'   => true,
            'event_priority'    => AnCommand::PRIORITY_LOWEST,
            'enable_callbacks'  => false,
            'callback_priority' => AnCommand::PRIORITY_HIGH,
        ));
        
        parent::_initialize($config);
    }