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.
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);
    }
159258
protected function _initialize(AnConfig $config)
     {
         $config->append(array(
             'content' => '',
             'content_type' => 'text/html',
             'status_code' => AnHttpResponse::OK,
             'status_message' => 'OK',
             'headers' => array(),
         ));

         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);
    }
1258953
protected function _initialize(AnConfig $config)
    {
        //by default every property is write protected
        //meaning it's not possibl to do mass assignement
        $config->append(array(
            'unique' => false,
            'required' => false,
            'write' => AnDomain::ACCESS_PUBLIC,
            'read' => AnDomain::ACCESS_PROTECTED,
        ));

        if (is_string($config->write)) {

            switch ($config->write) {

                case 'private' :
                    $config->write = AnDomain::ACCESS_PRIVATE;
                    break;

                case 'protected' :
                    $config->write = AnDomain::ACCESS_PROTECTED;
                    break;

                case 'public' :
                    $config->write = AnDomain::ACCESS_PUBLIC;
                    break;
            }
        }

        if (is_string($config->read)) {

            switch ($config->read) {

                case 'private' :
                    $config->read = AnDomain::ACCESS_PRIVATE;
                    break;

                case 'protected' :
                    $config->read = AnDomain::ACCESS_PROTECTED;
                    break;

                case 'public' :
                    $config->read = AnDomain::ACCESS_PUBLIC;
                    break;
            }
        }
    }
869077
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'identifiable_key' => 'pid',
            'priority' => AnCommand::PRIORITY_HIGHEST,
        ));

        parent::_initialize($config);
    }
878392
protected function initializeConfig(array $config = null)
    {
        $default = $this->defaultConfigurations();

        $this->config = $config ? array_replace_recursive($default, $config) : $default;
    }
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);
    }
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;
        }
    }
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);
    }
1195472
protected function _initialize(AnConfig $config)
    {
        if ($config->repository) {
            $config->append(array(
                'identifier' => $config->repository->getDescription()->getInheritanceColumnValue()->getIdentifier(),
                'node_type' => (string) $config->repository->getDescription()->getInheritanceColumnValue(),
                'commentable' => $config->repository->isCommentable(),
                'ownable' => $config->repository->isOwnable(),
                'hashtagable' => $config->repository->isHashtagable(),
                'geolocatable' => $config->repository->isGeolocatable()
            ));
        }

        parent::_initialize($config);
    }
974783
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'priority' => AnCommand::PRIORITY_LOWEST,
            'validator' => $this->_repository->getIdentifier()->name,
        ));

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

        parent::_initialize($config);
    }
1130332
protected function _initialize(AnConfig $config)
    {
        $paths[] = dirname($this->getIdentifier()->filepath).'/html';
        $paths[] = implode(DS, array(
                      ANPATH_THEMES,
                      AnService::get('com:application')->getTemplate(),
                      'html',
                      $this->getIdentifier()->type.'_'.$this->getIdentifier()->package,
                      $this->getName(), ));

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

        parent::_initialize($config);
    }
660452
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'paths' => array(
                ANPATH_ROOT.'/components/com_stories/templates/stories',
                ANPATH_ROOT.'/components/com_actors/templates/stories',
                ),
            'filters' => array('alias', 'shorttag'),
            'alias' => array(
                '@escape(' => 'htmlspecialchars(',
                '@route(' => 'route(',
                '@name(' => '$this->renderHelper(\'com://site/actors.template.helper.story.names\',',
                '@possessive(' => '$this->renderHelper(\'com://site/stories.template.helper.story.possessiveNoune\',$story,',
                '@link(' => '$this->renderHelper(\'com://site/actors.template.helper.story.link\',',
            ),
        ));

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

        $this->_entityset = $config->entityset;
        $this->_cardinality = $config->cardinality;

        if (is_numeric($this->_cardinality)) {
            $this->_cardinality = (int) $this->_cardinality;
        }

        $this->_delete_rule = $config->parent_delete;
        $this->_child_key = $config->child_key;
    }
436861
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
              'paths' => array(dirname(__FILE__).'/ui'),
        ));

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