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.
436861
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
              'paths' => array(dirname(__FILE__).'/ui'),
        ));

        parent::_initialize($config);
    }
909110
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'options' => array(),
            'charset' => 'UTF-8',
            'table_prefix' => 'an_',
            'table_needle' => '#__',
            'command_chain' => $this->getService('anahita:command.chain'),
            'dispatch_events' => true,
            'event_dispatcher' => $this->getService('anahita:event.dispatcher'),
            'enable_callbacks' => false,
            'connection' => 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(),
        ));
    }
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);
    }
675818
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'toolbars' => array($this->getIdentifier()->name, 'menubar', 'actorbar'),
        ));

        parent::_initialize($config);
    }
9629
protected function _initialize(AnConfig $config)
    {
        $description = $this->_description;

        $properties = $description->getProperty();

        $validations = array();

        foreach ($properties as $property) {

            if ($property->isAttribute() && $property->getFormat()) {
                $validations[$property->getName()]['format'] = $property->getFormat();
            }

            if ($property->isSerializable() && $property->isRequired()) {
                $validations[$property->getName()]['required'] = true;
            }

            if ($property->isSerializable() && $property->isUnique()) {
                $validations[$property->getName()]['uniqueness'] = array('scope' => array());
            }
        }

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

        parent::_initialize($config);
    }
946741
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'behaviors' => array(
                'parentable',
                'votable',
                'com:hashtags.controller.behavior.hashtagable',
                'com:people.controller.behavior.mentionable',
            ),
        ));

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

        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);
    }
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);
    }
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);
    }
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;
    }
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);
    }
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);
    }
706676
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'repository' => $config->mixer->getIdentifier()->name,
            'priority' => AnCommand::PRIORITY_HIGHEST,
        ));

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