apps/activity/lib/Data.php
/**
	 * Send an event into the activity stream
	 *
	 * @param IEvent $event
	 * @return bool
	 */
Send an event into the activity stream
@param IEvent $event
@return bool
Send an event into the activity stream @param IEvent $event @return bool
public function send(IEvent $event) {
		if ($event->getAffectedUser() === '' || $event->getAffectedUser() === null) {
			return false;
		}
		$queryBuilder = $this->connection->getQueryBuilder();
		$queryBuilder->insert('activity')
			->values([
				'app' => $queryBuilder->createParameter('app'),
				'subject' => $queryBuilder->createParameter('subject'),
				'subjectparams' => $queryBuilder->createParameter('subjectparams'),
				'message' => $queryBuilder->createParameter('message'),
				'messageparams' => $queryBuilder->createParameter('messageparams'),
				'file' => $queryBuilder->createParameter('object_name'),
				'link' => $queryBuilder->createParameter('link'),
				'user' => $queryBuilder->createParameter('user'),
				'affecteduser' => $queryBuilder->createParameter('affecteduser'),
				'timestamp' => $queryBuilder->createParameter('timestamp'),
				'priority' => $queryBuilder->createParameter('priority'),
				'type' => $queryBuilder->createParameter('type'),
				'object_type' => $queryBuilder->createParameter('object_type'),
				'object_id' => $queryBuilder->createParameter('object_id'),
			])
			->setParameters([
				'app' => $event->getApp(),
				'type' => $event->getType(),
				'affecteduser' => $event->getAffectedUser(),
				'user' => $event->getAuthor(),
				'timestamp' => (int) $event->getTimestamp(),
				'subject' => $event->getSubject(),
				'subjectparams' => json_encode($event->getSubjectParameters()),
				'message' => $event->getMessage(),
				'messageparams' => json_encode($event->getMessageParameters()),
				'priority' => IExtension::PRIORITY_MEDIUM,
				'object_type' => $event->getObjectType(),
				'object_id' => (int) $event->getObjectId(),
				'object_name' => $event->getObjectName(),
				'link' => $event->getLink(),
			])
			->execute();
		return true;
	}
public function send ( IEvent $ event ) { if ( $ event -> getAffectedUser ( ) === '' || $ event -> getAffectedUser ( ) === null ) { return false ; } $ queryBuilder = $ this -> connection -> getQueryBuilder ( ) ; $ queryBuilder -> insert ( 'activity' ) -> values ( [ 'app' => $ queryBuilder -> createParameter ( 'app' ) , 'subject' => $ queryBuilder -> createParameter ( 'subject' ) , 'subjectparams' => $ queryBuilder -> createParameter ( 'subjectparams' ) , 'message' => $ queryBuilder -> createParameter ( 'message' ) , 'messageparams' => $ queryBuilder -> createParameter ( 'messageparams' ) , 'file' => $ queryBuilder -> createParameter ( 'object_name' ) , 'link' => $ queryBuilder -> createParameter ( 'link' ) , 'user' => $ queryBuilder -> createParameter ( 'user' ) , 'affecteduser' => $ queryBuilder -> createParameter ( 'affecteduser' ) , 'timestamp' => $ queryBuilder -> createParameter ( 'timestamp' ) , 'priority' => $ queryBuilder -> createParameter ( 'priority' ) , 'type' => $ queryBuilder -> createParameter ( 'type' ) , 'object_type' => $ queryBuilder -> createParameter ( 'object_type' ) , 'object_id' => $ queryBuilder -> createParameter ( 'object_id' ) , ] ) -> setParameters ( [ 'app' => $ event -> getApp ( ) , 'type' => $ event -> getType ( ) , 'affecteduser' => $ event -> getAffectedUser ( ) , 'user' => $ event -> getAuthor ( ) , 'timestamp' => ( int ) $ event -> getTimestamp ( ) , 'subject' => $ event -> getSubject ( ) , 'subjectparams' => json_encode ( $ event -> getSubjectParameters ( ) ) , 'message' => $ event -> getMessage ( ) , 'messageparams' => json_encode ( $ event -> getMessageParameters ( ) ) , 'priority' => IExtension :: PRIORITY_MEDIUM , 'object_type' => $ event -> getObjectType ( ) , 'object_id' => ( int ) $ event -> getObjectId ( ) , 'object_name' => $ event -> getObjectName ( ) , 'link' => $ event -> getLink ( ) , ] ) -> execute ( ) ; return true ; }
Send an event into the activity stream
 @param IEvent $event
 @return bool
Send an event into the activity stream @param IEvent $event @return bool
// store in DB