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.
434689
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'can_register' => (bool) get_config_value('people.allow_registration', true),
        ));

        $this->_viewer = get_viewer();

        parent::_initialize($config);
    }
1145411
public static function init($config = [])
    {
        if (!self::$config) {
            self::$config = include __DIR__ ."/default-config.php";
        }
        self::$config = Arr::array_merge_multi(self::$config, $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);
    }
781000
protected function _initialize(AnConfig $config)
     {
         $config->append(array(
             'session' => false,
             'session_name' => $this->getName()
         ));

         parent::_initialize($config);
    }
480
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'name' => 'google',
            'version' => '3',
            'url' => 'https://maps.googleapis.com/maps/api/geocode/json?',
            'key' => get_config_value('locations.api_key', null)
        ));

        parent::_initialize($config);
    }
94750
protected function _initialize(AnConfig $config)
    {
        $entity_identifier = $config->entity_identifier;

        $config->append(array(
            'auto_generate' => false,
            'identity_property' => null,
            'aliases' => array(),
        ));
    }
1335034
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'signature' => new OAuthSignatureMethod_HMAC_SHA1(),
            'method' => AnHttpRequest::GET,
            'data' => array(),
            'options' => array(
                'timeout' => 30,
                'connection_timeout' => 30,
                'ssl' => false,
                'useragent' => 'com_connect',
            ),
        ));

        parent::_initialize($config);
    }
858230
public function setConfig(AnConfig $config)
    {
        //if the property configuration has been set
        //then don't allow it to change
        if (isset($this->__config)) {
            $this->__config->append($config);
            foreach ($this->__config as $key => $value) {
                $config[$key] = $this->__config[$key];
            }
        } else {
            $this->__config = $config;
        }

        $this->_name = $config->name;

        $this->_initialize($config);

        $this->_unique = $config->unique;
        $this->_required = $config->required;
        $this->_write_access = (int) $config->write;
        $this->_read_access = (int) $config->read;
    }
581405
protected function _initialize(AnConfig $config)
    {
        $path[] = dirname(__FILE__).'/ui';

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

        if (!$config->template) {
            $template = $this->getService('com:base.template.default');
            $template->addFilter('alias')->addFilter('shorttag');
            $config->append(array(
                 'template' => $template,
            ));
        }

        parent::_initialize($config);

        $paths = AnConfig::unbox($config->paths);
        array_unshift($paths, ANPATH_THEMES.'/'.AnService::get('application')->getTemplate().'/html/com_base/ui');
        $config->paths = $paths;
    }
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);
    }
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);
    }
449530
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'paths' => array(dirname(__FILE__).'/ui'),
        ));

        $paths = AnConfig::unbox($config->paths);
        array_unshift($paths, ANPATH_THEMES.'/'.$this->getService('application')->getTemplate().'/html/com_locations/ui');
        $config->paths = $paths;

        parent::_initialize($config);
    }
348516
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'cache_file' => ANPATH_CACHE.'/'.basename($this->_file).'.'.md5($this->_file),
        ));

        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);
        }
    }
783995
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'title'         => AnInflector::humanize(AnInflector::pluralize($this->getName())),
            'controller'    => null,
        ));

        parent::_initialize($config);
    }
1016444
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'resources' => array('sessions'),
            'attributes' => array(
                'id',
                'sessionId' => array(
                    'required' => true
                ),
                'username' => array(
                    'default' => ''
                ),
                'nodeId' => array(
                    'default' => 0
                ),
                'usertype' => array(
                    'default' => ComPeopleDomainEntityPerson::USERTYPE_GUEST,
                    'required' => true
                ),
                'guest' => array(
                    'default' => 1,
                    'required' => true
                ),
                'meta' => array(
                    'default' => '',
                ),
                'time' => array(
                    'default' => 0
                )
            )
        ));

        parent::_initialize($config);
    }
706676
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'repository' => $config->mixer->getIdentifier()->name,
            'priority' => AnCommand::PRIORITY_HIGHEST,
        ));

        parent::_initialize($config);
    }