Share an object using share adapters.

@param AnConfig $config An array options.
mixed object
ComActorsDomainEntityActor $subject
ComActorsDomainEntityActor $target
551847
public function shareObject($config = array())
    {
        $config = new AnConfig($config);

        if (!$config->object) {
            throw new InvalidArgumentException('Not object specified to share');
        }

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

        if ($config->object->isOwnable()) {
            $config->append(array(
                'target' => $config->object->owner,
            ));
        }

        $request = new ComSharesSharerRequest($config);
        $sharers = new ArrayObject();
        dispatch_plugin('connect.onGetShareAdapters', array('adapters' => $sharers, 'request' => $request));

        if ($config->sharers) {
            $sharers = array_filter((array) $sharers, function ($sharer) use ($config) {
               return in_array($sharer->getIdentifier()->name, $config['sharers']);
            });
        }

        foreach ($sharers as $sharer) {
            $sharer->shareRequest($request);
        }
    }
117274
protected function _initialize(AnConfig $config)
    {
		$config->append(array(
			'state' => self::STATE_ACTIVE,
			'expire' => LibSessionsDomainEntitySession::MAX_LIFETIME + time(),
			'security' => array('fix_browser'),
			'force_ssl' => is_ssl(),
			'namespace' => '__anahita',
			'storage' => 'database'
		));

		parent::_initialize($config);
	}
587604
protected function _initialize(AnConfig $config)
    {
        $base_url = AnRequest::base();
        $settings = $this->getService('com:settings.setting');

        if (PHP_SAPI == 'cli' && $settings->live_site != '') {
            $scheme = is_ssl() ? 'https://' : 'http://';
            $base_url = $scheme.$settings->live_site;
        }

        $config->append(array(
            'base_url' => $base_url,
            'test_options' => array(
                'enabled' => get_config_value('mailer.debug', false),
                'email' => get_config_value('mailer.redirect_email'),
                'log' => $settings->tmp_path . '/emails/',
            ),
            'template_view' => null,
        ));

        parent::_initialize($config);
    }
933567
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
             'priority' => AnCommand::PRIORITY_LOW,
             'auto_mixin' => true,
        ));

        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);
    }
531555
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'behaviors' => array(
                'oauthorizable',
                'ownable' => array(
                    'default' => $this->getService('com:people.viewer'),
                ),
            ),
        ));

        parent::_initialize($config);
    }
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);
    }
293176
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'attributes' => array(
                'id',
                'country' => array(
                    'required' => true,
                    'unique' => true,
                ),
                'meta' => array(
                    'type' => 'json',
                    'column' => 'data',
                    'default' => 'json',
                ),
            ),
            'behaviors' => array(
                'authorizer',
                'modifiable',
                'locatable',
            ),
        ));

        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);
    }
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);
    }
1361325
public function setConfig(AnConfig $config)
    {
        parent::setConfig($config);

        $this->_type = $config->type;

        if (!$this->isScalar()) {
            $this->_type = AnDomainAttribute::getClassname($this->_type);
        }

        $this->_default = $config->default;
        $this->_format = $config->format;
        $this->_column = $config->column;
    }
1020207
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'attributes' => array(
                'name' => array('required' => true),
                'type' => array('column' => 'body'),
                'creationTime' => array(
                    'default' => 'date',
                    'column' => 'created_on',
                ),
                'status' => array('default' => self::STATUS_NOT_SENT),
                'subscriberIds' => array(
                    'type' => 'set',
                    'default' => 'set',
                    'write' => 'private',
                    'required' => true,
                ),
            ),
            'behaviors' => array(
                  'serializable' => array('serializer' => 'com:stories.domain.serializer.story'),
                  'dictionariable',
            ),
            'relationships' => array(
                'object' => array(
                    'polymorphic' => true,
                    'type_column' => 'story_object_type',
                    'child_column' => 'story_object_id',
                ),
                'subject' => array(
                    'required' => true,
                    'parent' => 'com:actors.domain.entity.actor',
                    'child_column' => 'story_subject_id',
                ),
                'target' => array(
                    'required' => true,
                    'parent' => 'com:actors.domain.entity.actor',
                    'child_column' => 'story_target_id',
                ),
                'comment' => array(
                    'parent' => 'com:base.domain.entity.comment',
                    'child_column' => 'story_comment_id',
                ),
             ),
        ));

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

        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;
    }
743795
protected function _afterEntityInstantiate(AnConfig $config)
    {
        $entity = $config->entity;

        //set the last commentor to the author
        if ($this->getService()->has('com:people.viewer')) {
            $config->append(array(
                'data' => array(
                    'lastCommenter' => $this->getService('com:people.viewer'),
                ),
            ));
        }
    }
610132
protected function _initialize(AnConfig $config)
    {
        $config->append(array(
            'inheritance' => array('abstract' => $this->getIdentifier()->classname === __CLASS__),
            'relationships' => array(
                  'author' => array(
                      'parent' => 'com:people.domain.entity.person',
                      'child_column' => 'created_by',
                      'required' => true,
                   ),
            ),
            'attributes' => array(
                'name' => array('read' => 'public'),
                'enabled' => array('default' => 1)
             ),
            'behaviors' => array(
                'votable',
                'authorizer',
                'privatable',
                'ownable',
                'dictionariable',
                'subscribable',
                'describable',
                'com:hashtags.domain.behavior.hashtagable',
                'com:people.domain.behavior.mentionable',
                'com:locations.domain.behavior.geolocatable',
            ),
        ));

        $behaviors = $config->behaviors;

        $behaviors->append(array(
            'modifiable' => array(
                'modifiable_properties' => array('name', 'body'),
            ),
            'commentable' => array('comment' => array('length' => 5000)),
        ));

        parent::_initialize($config);
    }