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.
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);
    }
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);
    }
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);
    }
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);
    }
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;
    }
976769
public static function configure($object, array $options)
    {
        foreach ($options as $property => $value) {
            $object->$property = $value;
        }
    }
612297
public void init(String name, Map<String,Object> config) {
        if(config==null)
            config = Objects.newSOHashMap();
        this.name = name;
        this.config = config;
    }
531555
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'behaviors' => array(
                'oauthorizable',
                'ownable' => array(
                    'default' => $this->getService('com:people.viewer'),
                ),
            ),
        ));

        parent::_initialize($config);
    }
894465
public function initialize($object)
    {
        if (!is_object($object)) {
            return;
        }

        foreach ($this->knownDependencies as $interface => $dependencyInfo) {
            list($setterMethod, $serviceId) = $dependencyInfo;

            if (is_a($object, $interface)) {
                $object->$setterMethod($this->container->get($serviceId));
            }
        }
    }
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);
    }
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);
    }
348516
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'cache_file' => ANPATH_CACHE.'/'.basename($this->_file).'.'.md5($this->_file),
        ));

        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);
    }
1139114
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
           'polymorphic' => true,
        ));

        $relationship['polymorphic'] = $config->polymorphic;

        //if parent is set, then set the base parent
        if (isset($config['parent'])) {
            if (strpos($config['parent'], '.') === false) {
                $identifier = clone $config->service_identifier;

                $identifier->path = array('domain','entity');

                $identifier->name = $config['parent'];
            } else {
                $identifier = $this->getService($config['parent']);
            }

            $relationship['parent'] = $identifier;

            unset($config['parent']);

            $config->append(array(
                'aliases' => array($identifier->name => 'parent'),
            ));
        }

        $config->append(array(
            'relationships' => array(
                'parent' => $relationship,
            ),
        ));

        parent::_initialize($config);
    }
19601
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'enabled' => AnRequest::format() != 'json' && $config->mixer->isDispatched(),
        ));

        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);
    }
145530
protected function _initialize(AnConfig $config)
    {
        $settings = $this->getService('com:settings.setting');
        $database = $settings->db;
        $prefix = $settings->dbprefix;
        $port = null;
        $socket = null;
        $host = $settings->host;
        $username = $settings->user;
        $password = $settings->password;

        $targetSlot = substr(strstr($host, ":"), 1);

        if (!empty($targetSlot)) {
            // Get the port number or socket name
            if (is_numeric($targetSlot)) {
                $port = $targetSlot;
            } else {
                $socket = $targetSlot;
            }

            // Extract the host name only
            $host = substr($host, 0, strlen($host) - (strlen($targetSlot) + 1));

            // This will take care of the following notation: ":3306"
            if ($host === '') {
                $host = 'localhost';
            }
        }

        $config->append(array(
            'options' => array(
                'host' => $host,
                'username' => $username,
                'password' => $password,
                'database' => $database,
                'port' => $port,
                'socket' => $socket
            ),
            'table_prefix' => $settings->dbprefix,
            'charset' => 'utf8mb4'
        ));

        parent::_initialize($config);
    }