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.
974783
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'priority' => AnCommand::PRIORITY_LOWEST,
            'validator' => $this->_repository->getIdentifier()->name,
        ));

        parent::_initialize($config);
    }
1353377
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'behaviors' => array(
                'validatable',
                'com:mailer.controller.behavior.mailer'
            ),
            'request' => array(
                'reset_password' => 0,
                'edit' => 'profile'
            )
        ));

        parent::_initialize($config);

        AnHelperArray::unsetValues($config->behaviors, 'ownable');

        $this->_allowed_user_types = array(
            ComPeopleDomainEntityPerson::USERTYPE_ADMINISTRATOR,
            ComPeopleDomainEntityPerson::USERTYPE_REGISTERED,
        );

        $viewer = get_viewer();

        if ($viewer->superadmin()) {
            $this->_allowed_user_types[] = ComPeopleDomainEntityPerson::USERTYPE_SUPER_ADMINISTRATOR;
        }
    }
666602
protected function _initialize(AnConfig $config)
    {
        $child = clone $this->_parent;

        $child->name = AnInflector::singularize($config->name);

        $config->append(array(
            'entityset' => 'anahita:domain.entityset.onetomany',
            'cardinality' => 'many',
            'child_key' => $this->_parent->name,
            'parent_delete' => AnDomain::DELETE_CASCADE,
            'child' => $child,
        ));

        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);
    }
895612
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'attributes' => array(
                'access' => array(
                    'default' => get_config_value('people.access', self::GUEST)
                ),
                'permissions' => array(
                    'type' => 'json',
                    'default' => 'json',
                    'write' => 'private'
                ),
            ),
        ));

        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);
    }
218251
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'resources' => array('todos_todos'),
            'attributes' => array(
                'name' => array('required' => true),
                'openStatusChangeTime' => array(
                    'column' => 'open_status_change_time',
                    'default' => 'date',
                    'type' => 'date',
                    'write' => 'private', ),
                'priority' => array(
                    'column' => 'ordering',
                    'default' => self::PRIORITY_NORMAL,
                    'type' => 'integer',
                  ),
                ),
                'relationships' => array(
                    'lastChanger' => array(
                        'parent' => 'com:people.domain.entity.person',
                        'child_column' => 'open_status_change_by',
                    ),
                ),
            'behaviors' => array('enableable'),
            'aliases' => array('open' => 'enabled'),
        ));

        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);
    }
912389
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'viewer' => $this->getService('com:people.viewer'),
            'language' => 'com_'.$this->getIdentifier()->package,
            'behaviors' => to_hash('com:application.controller.behavior.message'),
        ));

        parent::_initialize($config);
    }
1029703
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'response' => 'com:base.dispatcher.response',
            'controller' => $this->getIdentifier()->package,
            'request' => array(),
        ));

        parent::_initialize($config);

        //prevent rendering layouts starting with _
        if (strpos($config->request->layout, '_') === 0) {
            unset($config->request->layout);
        }
    }
648411
protected function _initialize(AnConfig $config)
    {
        parent::_initialize($config);

        if ($config->request->view) {
            $config->controller = $config->request->view;
        }
    }
768744
public static function registerDefault($config)
    {
        if (!isset($config['identifier'])) {
            throw new AnException('identifier [AnServiceIdentifier] options is requied');
        }

        $strIdentifier = (string) $config['identifier'];

        if (isset($config['default'])) {
            $config['default'] = (array) $config['default'];
        } else {
            if (is_object($config['prefix'])) {
                $config['prefix'] = get_class(($config['prefix']));
            }

            if (empty($config['name'])) {
                $path = AnInflector::implode($config['identifier']->path);
                $config['name'] = array($path.ucfirst($config['identifier']->name), $path.'Default');
            }

            unset($config['default']);
        }

        self::$_identifiers[$strIdentifier] = $config;

        if (isset(self::$_defaults[$strIdentifier])) {
            unset(self::$_defaults[$strIdentifier]);
        }
    }
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);
    }
93637
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'profile_name' => ucfirst($this->getIdentifier()->package),
            'profile_description' => AnTranslator::_('COM-'.$this->getIdentifier()->package.'-APP-DESCRIPTION'),
            'profile_features' => array(),
            'assignment_option' => self::OPTION_OPTIONAL,
            'actor_identifiers' => array(),
            'relationships' => array(
                'assignments' => array(
                   'child' => 'com:components.domain.entity.assignment',
                   'child_key' => 'componentEntity',
                ),
            ),
        ));

        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);
    }
566998
protected function _initialize(AnConfig $config)
    {
        $config->append(array(

            'subscribe_after_follow' => $config->mixer->isSubscribable(),

            'attributes' => array(
                'allowFollowRequest' => array('default' => false),
                'followRequesterIds' => array('type' => 'set', 'default' => 'set', 'write' => 'private'),
                'followerCount' => array('default' => 0, 'write' => 'private'),
                'followerIds' => array('type' => 'set', 'default' => 'set', 'write' => 'private'),
                'blockedIds' => array('type' => 'set', 'default' => 'set', 'write' => 'private'),
                'blockerIds' => array('type' => 'set', 'default' => 'set', 'write' => 'private'),
            ),

            'relationships' => array(

                'requesters' => array(
                    'parent_delete' => 'ignore',
                    'through' => 'com:actors.domain.entity.request',
                    'target' => 'com:actors.domain.entity.actor',
                    'child_key' => 'requestee',
                ),

                'followers' => array(
                    'parent_delete' => 'ignore',
                    'through' => 'com:actors.domain.entity.follow',
                    'target' => 'com:actors.domain.entity.actor',
                    'child_key' => 'leader',
                ),

                'blockeds' => array(
                    'parent_delete' => 'ignore',
                    'through' => 'com:actors.domain.entity.block',
                    'target' => 'com:actors.domain.entity.actor',
                    'child_key' => 'blocker',
                ),
            ),
        ));

        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);
    }