Пример #1
0
 /**
  * Constructor.
  *
  * @param KConfig $config An optional KConfig object with configuration options.
  */
 public function __construct(KConfig $config)
 {
     parent::__construct($config);
     if (!$this->_repository->entityInherits('ComBaseDomainEntityNode')) {
         throw new InvalidArgumentException($this->_repository->getDescription()->getEntityIdentifier() . ' is not a node');
     }
 }
Пример #2
0
 /**
  * Initializes the default configuration for the object.
  *
  * Called from {@link __construct()} as a first step of object instantiation.
  *
  * @param KConfig $config An optional KConfig object with configuration options.
  */
 protected function _initialize(KConfig $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);
 }
Пример #3
0
 /**
  * Initializes the default configuration for the object.
  *
  * Called from {@link __construct()} as a first step of object instantiation.
  *
  * @param KConfig $config An optional KConfig object with configuration options.
  */
 protected function _initialize(KConfig $config)
 {
     $config->append(array('attributes' => array('leaderCount' => array('default' => 0, 'write' => 'private'), 'leaderIds' => array('type' => 'set', 'default' => 'set', 'write' => 'private'), 'blockerIds' => array('type' => 'set', 'default' => 'set', 'write' => 'private'), 'mutualIds' => array('type' => 'set', 'default' => 'set', 'write' => 'private'), 'mutualCount' => array('default' => 0, 'write' => 'private')), 'relationships' => array('blockers' => array('through' => 'com:actors.domain.entity.block', 'parent_delete' => 'ignore', 'child_key' => 'blocked', 'target' => 'com:actors.domain.entity.actor'), 'leaders' => array('parent_delete' => 'ignore', 'through' => 'com:actors.domain.entity.follow', 'child_key' => 'follower', 'target' => 'com:actors.domain.entity.actor'))));
     parent::_initialize($config);
 }
Пример #4
0
 /**
  * Initializes the default configuration for the object.
  *
  * Called from {@link __construct()} as a first step of object instantiation.
  *
  * @param KConfig $config An optional KConfig object with configuration options.
  */
 protected function _initialize(KConfig $config)
 {
     $config->append(array('attributes' => array('startDate' => array('required' => true, 'type' => 'date', 'default' => 'date'), 'endDate' => array('required' => true, 'type' => 'date'))));
     parent::_initialize($config);
 }
Пример #5
0
 /**
  * Initializes the default configuration for the object.
  *
  * Called from {@link __construct()} as a first step of object instantiation.
  *
  * @param KConfig $config An optional KConfig object with configuration options.
  */
 protected function _initialize(KConfig $config)
 {
     $config->append(array('priority' => KCommand::PRIORITY_LOWEST, 'validator' => $this->_repository->getIdentifier()->name));
     parent::_initialize($config);
 }
Пример #6
0
 /**
  * Initializes the default configuration for the object.
  *
  * Called from {@link __construct()} as a first step of object instantiation.
  *
  * @param KConfig $config An optional KConfig object with configuration options.
  */
 protected function _initialize(KConfig $config)
 {
     $config->append(array('relationships' => array('hashtags' => array('through' => 'com:hashtags.domain.entity.tag', 'target' => 'com:base.domain.entity.node', 'child_key' => 'tagable', 'target_child_key' => 'hashtag', 'inverse' => true))));
     parent::_initialize($config);
 }
Пример #7
0
 /**
  * Initializes the default configuration for the object
  *
  * Called from {@link __construct()} as a first step of object instantiation.
  *
  * @param KConfig $config An optional KConfig object with configuration options.
  *
  * @return void
  */
 protected function _initialize(KConfig $config)
 {
     $config->append(array('relationships' => array('owners' => array('parent_delete' => 'ignore', 'through' => 'com:base.domain.entity.ownership', 'as' => 'ownership', 'child_key' => 'ownable', 'target' => 'com:actors.domain.entity.actor')), 'attributes' => array('sharedOwnerIds' => array('type' => 'set', 'default' => 'set', 'write' => 'private'), 'sharedOwnerCount' => array('type' => 'integer', 'write' => 'private'))));
     parent::_initialize($config);
 }
Пример #8
0
 /**
  * Initializes the default configuration for the object.
  *
  * Called from {@link __construct()} as a first step of object instantiation.
  *
  * @param KConfig $config An optional KConfig object with configuration options.
  */
 protected function _initialize(KConfig $config)
 {
     $config->append(array('attributes' => array('subscriberCount' => array('default' => 0, 'write' => 'private'), 'subscriberIds' => array('type' => 'set', 'default' => 'set', 'write' => 'private')), 'relationships' => array('subscriptions' => array('child' => 'com:base.domain.entity.subscription', 'child_key' => 'subscribee', 'parent_delete' => 'ignore'))));
     parent::_initialize($config);
 }
Пример #9
0
 /**
  * Initializes the default configuration for the object
  *
  * Called from {@link __construct()} as a first step of object instantiation.
  *
  * @param KConfig $config An optional KConfig object with configuration options.
  *
  * @return void
  */
 protected function _initialize(KConfig $config)
 {
     $config->append(array('attributes' => array('pinned' => array('column' => 'pinned', 'type' => 'boolean', 'default' => false, 'required' => true))));
     parent::_initialize($config);
 }
Пример #10
0
 /**
  * Initializes the default configuration for the object
  *
  * Called from {@link __construct()} as a first step of object instantiation.
  *
  * @param KConfig $config An optional KConfig object with configuration options.
  *
  * @return void
  */
 protected function _initialize(KConfig $config)
 {
     $config->append(array('searchable_properties' => array('name', 'body'), 'attributes' => array('name' => array('format' => 'string'), 'body' => array('format' => 'string'), 'alias' => array('format' => 'slug')), 'aliases' => array('title' => 'name', 'description' => 'body')));
     parent::_initialize($config);
 }
Пример #11
0
 /**
  * Initializes the default configuration for the object.
  *
  * Called from {@link __construct()} as a first step of object instantiation.
  *
  * @param KConfig $config An optional KConfig object with configuration options.
  */
 protected function _initialize(KConfig $config)
 {
     $config->append(array('attributes' => array('enabled' => array('default' => false, 'write_access' => 'private'))));
     parent::_initialize($config);
 }
Пример #12
0
 /**
  * Initializes the default configuration for the object
  *
  * Called from {@link __construct()} as a first step of object instantiation.
  *
  * @param KConfig $config An optional KConfig object with configuration options.
  *
  * @return void
  */
 protected function _initialize(KConfig $config)
 {
     $config->append(array('scopes' => array(), 'attributes' => array('isDefault' => array('default' => false))));
     parent::_initialize($config);
 }
Пример #13
0
 /**
  * Initializes the default configuration for the object
  *
  * Called from {@link __construct()} as a first step of object instantiation.
  *
  * @param KConfig $config An optional KConfig object with configuration options.
  *
  * @return void
  */
 protected function _initialize(KConfig $config)
 {
     $config->append(array('attributes' => array('enabled' => array('default' => true))));
     parent::_initialize($config);
 }
Пример #14
0
 /**
  * Initializes the default configuration for the object.
  *
  * Called from {@link __construct()} as a first step of object instantiation.
  *
  * @param KConfig $config An optional KConfig object with configuration options.
  */
 protected function _initialize(KConfig $config)
 {
     $config->append(array('attributes' => array('userId' => array('column' => 'person_userid', 'key' => true, 'type' => 'integer', 'default' => mt_rand()))));
     parent::_initialize($config);
 }
Пример #15
0
 /**
  * Initializes the default configuration for the object.
  *
  * Called from {@link __construct()} as a first step of object instantiation.
  *
  * @param KConfig $config An optional KConfig object with configuration options.
  */
 protected function _initialize(KConfig $config)
 {
     $config->append(array('attributes' => array('hits' => array('default' => 0, 'write' => 'private'))));
     parent::_initialize($config);
 }
Пример #16
0
 /**
  * Initializes the default configuration for the object
  *
  * Called from {@link __construct()} as a first step of object instantiation.
  *
  * @param KConfig $config An optional KConfig object with configuration options.
  *
  * @return void
  */
 protected function _initialize(KConfig $config)
 {
     $config->append(array('relationships' => array('subscription' => array('type' => 'has', 'child' => 'com:subscriptions.domain.entity.subscription'))));
     parent::_initialize($config);
 }
Пример #17
0
 /**
  * Initializes the default configuration for the object
  *
  * Called from {@link __construct()} as a first step of object instantiation.
  *
  * @param KConfig $config An optional KConfig object with configuration options.
  *
  * @return void
  */
 protected function _initialize(KConfig $config)
 {
     $config->append(array('modifiable_properties' => array(), 'attributes' => array('creationTime' => array('column' => 'created_on', 'default' => 'date', 'required' => true), 'updateTime' => array('column' => 'modified_on', 'default' => 'date')), 'relationships' => array('author' => array('parent' => 'com:people.domain.entity.person', 'child_column' => 'created_by'), 'editor' => array('parent' => 'com:people.domain.entity.person', 'child_column' => 'modified_by'))));
     parent::_initialize($config);
 }
Пример #18
0
 /**
  * Initializes the default configuration for the object.
  *
  * Called from {@link __construct()} as a first step of object instantiation.
  *
  * @param KConfig $config An optional KConfig object with configuration options.
  */
 protected function _initialize(KConfig $config)
 {
     $config->append(array('scopes' => array(), 'attributes' => array('ordering' => array('default' => 0)), 'aliases' => array('order' => 'ordering')));
     parent::_initialize($config);
 }
Пример #19
0
 /**
  * Initializes the default configuration for the object
  *
  * Called from {@link __construct()} as a first step of object instantiation.
  *
  * @param KConfig $config An optional KConfig object with configuration options.
  *
  * @return void
  */
 protected function _initialize(KConfig $config)
 {
     $config->append(array('relationships' => array('owner' => array('polymorphic' => true, 'required' => true, 'parent' => 'com:actors.domain.entity.actor', 'inverse' => true))));
     parent::_initialize($config);
 }
Пример #20
0
 /**
  * Initializes the default configuration for the object.
  *
  * Called from {@link __construct()} as a first step of object instantiation.
  *
  * @param KConfig $config An optional KConfig object with configuration options.
  */
 protected function _initialize(KConfig $config)
 {
     $config->append(array('attributes' => array('voteUpCount' => array('default' => 0, 'write' => 'private'), 'voteDownCount' => array('default' => 0, 'write' => 'private'), 'voterUpIds' => array('type' => 'set', 'default' => 'set', 'write' => 'private'), 'voterDownIds' => array('type' => 'set', 'default' => 'set', 'write' => 'private')), 'relationships' => array('voteups' => array('child' => 'com:base.domain.entity.voteup', 'child_key' => 'votee', 'parent_delete' => 'ignore'), 'votedowns' => array('child' => 'com:base.domain.entity.votedown', 'child_key' => 'votee', 'parent_delete' => 'ignore'))));
     parent::_initialize($config);
 }
Пример #21
0
 /**
  * Initializes the default configuration for the object.
  *
  * Called from {@link __construct()} as a first step of object instantiation.
  *
  * @param KConfig $config An optional KConfig object with configuration options.
  */
 protected function _initialize(KConfig $config)
 {
     $config->append(array('attributes' => array('openToComment' => array('column' => 'comment_status', 'default' => true, 'write' => 'protected'), 'numOfComments' => array('column' => 'comment_count', 'default' => 0, 'write' => 'private'), 'lastCommentTime' => array('column' => 'last_comment_on', 'write' => 'private')), 'relationships' => array('lastComment' => array('parent' => 'comment', 'write' => 'private'), 'lastCommenter' => array('parent' => 'com:people.domain.entity.person', 'child_column' => 'last_comment_by', 'write' => 'private'), 'comments' => array('child' => 'comment', 'child_key' => 'parent', 'parent_delete' => 'ignore')), 'comment' => array()));
     parent::_initialize($config);
 }
Пример #22
0
 /**
  * Initializes the default configuration for the object
  *
  * Called from {@link __construct()} as a first step of object instantiation.
  *
  * @param KConfig $config An optional KConfig object with configuration options.
  *
  * @return void
  */
 protected function _initialize(KConfig $config)
 {
     $config->append(array('attributes' => array('notificationIds' => array('type' => 'set', 'default' => 'set', 'write' => 'private'), 'newNotificationIds' => array('type' => 'set', 'default' => 'set', 'write' => 'private'))));
     parent::_initialize($config);
 }
Пример #23
0
 /**
  * Initializes the default configuration for the object
  *
  * Called from {@link __construct()} as a first step of object instantiation.
  *
  * @param KConfig $config An optional KConfig object with configuration options.
  *
  * @return void
  */
 protected function _initialize(KConfig $config)
 {
     $config->append(array('enable' => true, 'priority' => KCommand::PRIORITY_LOWEST));
     parent::_initialize($config);
 }
Пример #24
0
 /**
  * Initializes the default configuration for the object.
  *
  * Called from {@link __construct()} as a first step of object instantiation.
  *
  * @param KConfig $config An optional KConfig object with configuration options.
  */
 protected function _initialize(KConfig $config)
 {
     $config->append(array('storage' => $this->getService('plg:storage.default')));
     parent::_initialize($config);
 }
Пример #25
0
 /**
  * Initializes the default configuration for the object.
  *
  * Called from {@link __construct()} as a first step of object instantiation.
  *
  * @param KConfig $config An optional KConfig object with configuration options.
  */
 protected function _initialize(KConfig $config)
 {
     $config->append(array('attributes' => array('administratingIds' => array('type' => 'set', 'default' => 'set'))));
     parent::_initialize($config);
 }
Пример #26
0
 /**
  * Initializes the default configuration for the object.
  *
  * Called from {@link __construct()} as a first step of object instantiation.
  *
  * @param KConfig $config An optional KConfig object with configuration options.
  */
 protected function _initialize(KConfig $config)
 {
     $config->append(array('authorizers' => array($config->mixer->getIdentifier()->name)));
     parent::_initialize($config);
 }
Пример #27
0
 /**
  * Initializes the default configuration for the object.
  *
  * Called from {@link __construct()} as a first step of object instantiation.
  *
  * @param KConfig $config An optional KConfig object with configuration options.
  */
 protected function _initialize(KConfig $config)
 {
     $config->append(array('attributes' => array('access' => array('default' => self::GUEST), 'permissions' => array('type' => 'json', 'default' => 'json', 'write' => 'private'))));
     parent::_initialize($config);
 }
Пример #28
0
 /**
  * Initializes the default configuration for the object
  *
  * Called from {@link __construct()} as a first step of object instantiation.
  *
  * @param KConfig $config An optional KConfig object with configuration options.
  *
  * @return void
  */
 protected function _initialize(KConfig $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);
 }
Пример #29
0
 /**
  * Initializes the default configuration for the object
  *
  * Called from {@link __construct()} as a first step of object instantiation.
  *
  * @param KConfig $config An optional KConfig object with configuration options.
  *
  * @return void
  */
 protected function _initialize(KConfig $config)
 {
     $config->append(array('attributes' => array('administratorIds' => array('type' => 'set', 'default' => 'set', 'write' => 'private')), 'relationships' => array('administrators' => array('parent_delete' => 'ignore', 'through' => 'com:actors.domain.entity.administrator', 'target' => 'com:people.domain.entity.person', 'child_key' => 'administrable'))));
     parent::_initialize($config);
 }