public static function subscribe($event, $type, $entity) {

		if (!$entity instanceof Comment) {
			return;
		}

		$original_container = $entity->getOriginalContainer();
		if (!$original_container instanceof \ElggObject) {
			// Let core subscriptions deal with it
			return;
		}

		if (check_entity_relationship($entity->owner_guid, 'comment_tracker_unsubscribed', $original_container->guid)) {
			// User unsubscribed from notifications about this container
			return;
		}

		add_entity_relationship($entity->owner_guid, 'comment_subscribe', $original_container->guid);
	}
public static function subscribe($event, $type, $entity) {

		if (!$entity instanceof Comment) {
			return;
		}

		$original_container = $entity->getOriginalContainer();
		if (!$original_container instanceof \ElggObject) {
			// Let core subscriptions deal with it
			return;
		}

		if (check_entity_relationship($entity->owner_guid, 'comment_tracker_unsubscribed', $original_container->guid)) {
			// User unsubscribed from notifications about this container
			return;
		}

		add_entity_relationship($entity->owner_guid, 'comment_subscribe', $original_container->guid);
	}
public static function subscribe ( $ event , $ type , $ entity ) { if ( ! $ entity instanceof Comment ) { return ; } $ original_container = $ entity -> getOriginalContainer ( ) ; if ( ! $ original_container instanceof \ ElggObject ) { // Let core subscriptions deal with it return ; } if ( check_entity_relationship ( $ entity -> owner_guid , 'comment_tracker_unsubscribed' , $ original_container -> guid ) ) { // User unsubscribed from notifications about this container return ; } add_entity_relationship ( $ entity -> owner_guid , 'comment_subscribe' , $ original_container -> guid ) ; }
Subscribe users to notifications about the thread

@param string      $event  "create"
@param string      $type   "object"
@param \ElggEntity $entity Object

@return void
Subscribe users to notifications about the thread