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.
348516
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'cache_file' => ANPATH_CACHE.'/'.basename($this->_file).'.'.md5($this->_file),
        ));

        parent::_initialize($config);
    }
800008
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'inheritance' => array(
                'abstract' => $this->getIdentifier()->classname === __CLASS__,
                'column' => 'type',
                'ignore' => array(),
            ),
            'resources' => array(
                array(
                    'name' => 'edges',
                    'alias' => $this->getIdentifier()->name,
                    ),
            ),
            'attributes' => array(
                'id' => array('key' => true),
            ),
            'behaviors' => array(
                'modifiable',
            ),
            'relationships' => array(
                'nodeA' => array(
                        'required' => true,
                        'polymorphic' => true,
                        'parent' => 'com:base.domain.entity.node',
                    ),
                'nodeB' => array(
                    'required' => true,
                    'polymorphic' => true,
                    'parent' => 'com:base.domain.entity.node',
                    ),
            ),
        ));

        return 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);
    }
338966
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'asset_paths' => array(ANPATH_THEMES.'/'.AnService::get('application')->getTemplate().'/media'),
        ));

        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);
    }
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);
    }
852893
protected function _initialize(AnConfig $config)
    {
        $identifier = clone $this->_parent;
        $identifier->name = AnInflector::singularize($this->_name);
        $config->append(array(
            'entityset' => 'anahita:domain.entityset.manytomany',
            'target' => $identifier,
            'target_child_key' => AnInflector::variablize($identifier->name),
            'target_parent_key' => 'id',
        ));

        if (!$config->as) {
            //keep the as always the same for the two many to many relationship
            $names = array($config->parent->name, AnInflector::singularize($config->name));
            sort($names);
            $config->as = $names[0].ucfirst(AnInflector::pluralize($names[1]));
        }

        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;
    }
194258
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'readonly' => false,
            'enabled' => true,
            'token' => null,
            'version' => '1.0',
            'scope' => array(),
            'consumer' => new ComConnectOauthConsumer(new AnConfig()),
            'response_format' => 'json',
            'api_url' => '',
            'request_token_url' => '',
            'access_token_url' => '',
            'authenticate_url' => '',
            'authorize_url' => '',
        ));

        parent::_initialize($config);
    }
781000
protected function _initialize(AnConfig $config)
     {
         $config->append(array(
             'session' => false,
             'session_name' => $this->getName()
         ));

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

        $identifier->path = array();

        $paths[] = ANPATH_THEMES.DS.'base'.DS.$this->getFormat();
        $paths[] = ANPATH_BASE.dirname($identifier->filepath).DS.$this->getFormat();

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

        $params = '';

        if (is_readable($file = ANPATH_THEMES.DS.$this->getIdentifier()->package.DS.'params.ini')) {
            $params = parse_ini_file($file);
        }

        $config->append(array(
            'mimetype' => 'text/html',
            'params' => $params,
            'template_filters' => array('shorttag', 'html', 'alias'),
        ));

        parent::_initialize($config);
    }
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);
    }
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);
    }
744984
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'inheritance' => array('abstract' => $this->getIdentifier()->classname === __CLASS__),
            'aliases' => array(
                'tag' => 'nodeA',
                'tagable' => 'nodeB',
            ),
        ));

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

        $this->_type_column = $config->type_column;

        $this->_child_column = $config->child_column;

        $this->_polymorphic = $config->polymorphic === true;

        if (!isset($this->_parent)) {
            $this->_polymorphic = true;
        }
    }
148763
protected function _initialize(ObjectConfig $config)
    {
        $config->append(array(
            'priority' => self::PRIORITY_NORMAL
        ));

        parent::_initialize($config);
    }
1142294
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'inheritance' => array(
                'abstract' => $this->getIdentifier()->classname == __CLASS__
            ),
            'attributes' => to_hash(array(
                'name' => array(
                    'required' => AnDomain::VALUE_NOT_EMPTY,
                    'format' => 'string',
                    'read' => 'public'
                ),
                'body' => array('format' => 'string'),
                'status',
                'statusUpdateTime',
                'meta' => array(
                    'type' => 'json',
                    'default' => 'json',
                    'write' => 'private'
                ),
            )),
            'behaviors' => to_hash(array(
                'subscribable',
                'modifiable',
                'storable',
                'describable',
                'authorizer',
                'privatable',
                'administrable',
                'enableable',
                'verifiable',
                'dictionariable',
                'followable',
                'com:hashtags.domain.behavior.hashtagable',
                'com:locations.domain.behavior.geolocatable',
                'coverable',
                'portraitable' => array(
                        'sizes' => array(
                                'small' => '80xauto',
                                'medium' => '160xauto',
                                'large' => '480xauto',
                                'square' => 56, ), ),
                            )
            ), 
        ));
        
        parent::_initialize($config);
    }