Initializes the default configuration for the object.

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

@param AnConfig $config An optional AnConfig object with configuration options.
967652
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'priority' => AnCommand::PRIORITY_HIGH,
        ));

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

        $config->append(array(
    		'charset' => 'utf-8',
            'maxLineLength' => 900,
            'priority' => self::PRIORITY_NORMAL,
            'contentType' => 'text/html',
            'site_settings' => $settings
        ))->append(array(
            'mailer' => $settings->mailer
        ));

        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');
    }
878392
protected function initializeConfig(array $config = null)
    {
        $default = $this->defaultConfigurations();

        $this->config = $config ? array_replace_recursive($default, $config) : $default;
    }
531555
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'behaviors' => array(
                'oauthorizable',
                'ownable' => array(
                    'default' => $this->getService('com:people.viewer'),
                ),
            ),
        ));

        parent::_initialize($config);
    }
1092305
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'attributes' => array(
                'name' => array('required' => true),
                'excerpt' => array(
                    'required' => AnDomain::VALUE_NOT_EMPTY,
                    'format' => 'string',
                ),
                'body' => array('format' => 'html'),
            ),
            'relationships' => array(
                'revisions',
            ),
            'aliases' => array(
                'published' => 'enabled',
                'title' => 'name',
            ),
        ));

        $config->append(array(
            'behaviors' => array(
                'coverable',
                'hittable',
                'pinnable',
                'modifiable' => array(
                    'modifiable_properties' => array('excerpt', 'name', 'body'),
                )
            ),
        ));

        parent::_initialize($config);
    }
268121
protected function _initialize(AnConfig $config)
    {
        if (empty($config->resources)) {
            $resource = $this->getIdentifier()->package.'_'.AnInflector::pluralize($this->getIdentifier()->name);

            $config->append(array(
                'resources' => array($resource),
            ));
        }

        $entityset = clone $this->getIdentifier();
        $entityset->path = array('domain','entityset');
        register_default(array(
            'identifier' => $entityset,
            'prefix' => $config->prototype,
          ));

        $description = clone $this->getIdentifier();
        $description->path = array('domain','description');
        register_default(array(
            'identifier' => $description,
            'prefix' => $config->prototype, 
        ));

        $query = clone $this->getIdentifier();
        $query->path = array('domain','query');
        register_default(array(
            'identifier' => $query,
            'prefix' => $config->prototype, 
        ));

        $config->append(array(
            'query' => $query,
            'space' => $this->getService('anahita:domain.space'),
            'store' => $this->getService('anahita:domain.store.database'),
            'entityset' => $entityset,
            'description' => $description,
            'command_chain' => $this->getService('anahita:command.chain'),
            'event_dispatcher' => $this->getService('anahita:event.dispatcher'),
            'dispatch_events' => true,
            'enable_callbacks' => true,
            'behaviors' => array(
                'validatable',
                'cachable',
                'serializable',
            ),
        ));

        //set the resources
        $resources = array_reverse((array) AnConfig::unbox($config->resources));
        $config['resources'] = new AnDomainResourceSet(new AnConfig(array('store' => $config->store, 'resources' => $resources)));
        $config['repository'] = $this;

        parent::_initialize($config);
    }
405249
protected function _initialize(AnConfig $config)
    {
        $permission = clone $this->getIdentifier();
        $permission->path = array($permission->path[0], 'permission');
        register_default(array('identifier' => $permission, 'prefix' => $this));

        $config->append(array(
            'behaviors' => array($permission),
            'request' => array('format' => 'html'),
        ))->append(array(
            'view' => $config->request->get ? $config->request->get : ($config->request->view ? $config->request->view : $this->getIdentifier()->name),
        ));

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

        $this->_type = $config->type;

        if (!$this->isScalar()) {
            $this->_type = AnDomainAttribute::getClassname($this->_type);
        }

        $this->_default = $config->default;
        $this->_format = $config->format;
        $this->_column = $config->column;
    }
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);
    }
905026
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'enable' => true,
            'priority' => AnCommand::PRIORITY_LOWEST,
        ));

        parent::_initialize($config);
    }
669245
protected function _initialize(AnConfig $config)
    {
        $name = explode('_', $this->_name);

        $config->append(array(
            'link_type' => 'strong',
            'alias' => AnInflector::singularize($name[count($name) - 1]).'_tbl',
        ));

        parent::_initialize($config);
    }
660452
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'paths' => array(
                ANPATH_ROOT.'/components/com_stories/templates/stories',
                ANPATH_ROOT.'/components/com_actors/templates/stories',
                ),
            'filters' => array('alias', 'shorttag'),
            'alias' => array(
                '@escape(' => 'htmlspecialchars(',
                '@route(' => 'route(',
                '@name(' => '$this->renderHelper(\'com://site/actors.template.helper.story.names\',',
                '@possessive(' => '$this->renderHelper(\'com://site/stories.template.helper.story.possessiveNoune\',$story,',
                '@link(' => '$this->renderHelper(\'com://site/actors.template.helper.story.link\',',
            ),
        ));

        parent::_initialize($config);
    }
887197
protected function _initialize(AnConfig $config)
    {
        $base = clone AnRequest::base();

        foreach (array('host', 'scheme', 'port', 'user', 'pass') as $part) {
            $base->$part = AnRequest::url()->$part;
        }

        if (PHP_SAPI == 'cli') {
            $base->scheme = extension_loaded('openssl') ? 'https' : 'http';
            $settings = $this->getService('com:settings.setting');
            $base->host = AnRequest::get('server.HOSTNAME', 'url', $settings->live_site);
            $base->path = '';
        }

        $config->append(array(
            'base_url' => $base,
            'enable_rewrite' => false,
            'url' => clone AnService::get('anahita:http.url')
        ));

        parent::_initialize($config);
    }
398240
public function setConfig(AnConfig $config)
    {
        $identifier = $config->description->getRepository()->getIdentifier();

        if ($config->parent) {
            $this->_parent = AnService::getIdentifier($config->parent);

            //adopt the child application
            if (!$this->_parent->application) {
                $this->_parent->application = $identifier->application;
            }
        }

        parent::setConfig($config);

        if ($config->child) {
            if (strpos($config->child, '.') === false) {
                $identifier = clone $this->_parent;
                $identifier->name = $config->child;
                $config->child = $identifier;
            }
            $this->_child = AnService::getIdentifier($config->child);
            //adopt the parent application
            if (!$this->_child->application) {
                $this->_child->application = $identifier->application;
            }
        }

        $this->_parent_key = $config->parent_key;

        if (is_array($config->query)) {
            $config->query = new AnConfig($config->query);
        }

        $this->_query_filters = $config->query;
    }
265482
protected function _initialize(AnConfig $config)
    {
        $this->getService('anahita:language')->load('com_'.$this->getIdentifier()->package);

        $config->append(array(
            'resources' => array('components'),
            'attributes' => array(
                'meta' => array(
                    'required' => false,
                    'default' => ''
                ),
                'enabled',
            ),
            'behaviors' => array(
                'orderable',
                'authorizer',
            ),
            'query_options' => array(
                'where' => array('parent' => 0)
            ),
            'aliases' => array(
                'component' => 'option',
             ),
            'auto_generate' => true,
        ));

        parent::_initialize($config);
    }