apps/activity/lib/Data.php
/**
	 * Send an event as email
	 *
	 * @param IEvent $event
	 * @param int    $latestSendTime Activity $timestamp + batch setting of $affectedUser
	 * @return bool
	 */
Send an event as email
@param IEvent $event
@param int    $latestSendTime Activity $timestamp + batch setting of $affectedUser
@return bool
Send an event as email @param IEvent $event @param int $latestSendTime Activity $timestamp + batch setting of $affectedUser @return bool
public function storeMail(IEvent $event, $latestSendTime) {
		if ($event->getAffectedUser() === '' || $event->getAffectedUser() === null) {
			return false;
		}
		$queryBuilder = $this->connection->getQueryBuilder();
		$queryBuilder->insert('activity_mq')
			->values([
				'amq_appid' => $queryBuilder->createParameter('app'),
				'amq_subject' => $queryBuilder->createParameter('subject'),
				'amq_subjectparams' => $queryBuilder->createParameter('subjectparams'),
				'amq_affecteduser' => $queryBuilder->createParameter('affecteduser'),
				'amq_timestamp' => $queryBuilder->createParameter('timestamp'),
				'amq_type' => $queryBuilder->createParameter('type'),
				'amq_latest_send' => $queryBuilder->createParameter('latest_send'),
			])
			->setParameters([
				'app' => $event->getApp(),
				'subject' => $event->getSubject(),
				'subjectparams' => json_encode($event->getSubjectParameters()),
				'affecteduser' => $event->getAffectedUser(),
				'timestamp' => (int) $event->getTimestamp(),
				'type' => $event->getType(),
				'latest_send' => $latestSendTime,
			])
			->execute();
		return true;
	}
public function storeMail ( IEvent $ event , $ latestSendTime ) { if ( $ event -> getAffectedUser ( ) === '' || $ event -> getAffectedUser ( ) === null ) { return false ; } $ queryBuilder = $ this -> connection -> getQueryBuilder ( ) ; $ queryBuilder -> insert ( 'activity_mq' ) -> values ( [ 'amq_appid' => $ queryBuilder -> createParameter ( 'app' ) , 'amq_subject' => $ queryBuilder -> createParameter ( 'subject' ) , 'amq_subjectparams' => $ queryBuilder -> createParameter ( 'subjectparams' ) , 'amq_affecteduser' => $ queryBuilder -> createParameter ( 'affecteduser' ) , 'amq_timestamp' => $ queryBuilder -> createParameter ( 'timestamp' ) , 'amq_type' => $ queryBuilder -> createParameter ( 'type' ) , 'amq_latest_send' => $ queryBuilder -> createParameter ( 'latest_send' ) , ] ) -> setParameters ( [ 'app' => $ event -> getApp ( ) , 'subject' => $ event -> getSubject ( ) , 'subjectparams' => json_encode ( $ event -> getSubjectParameters ( ) ) , 'affecteduser' => $ event -> getAffectedUser ( ) , 'timestamp' => ( int ) $ event -> getTimestamp ( ) , 'type' => $ event -> getType ( ) , 'latest_send' => $ latestSendTime , ] ) -> execute ( ) ; return true ; }
Send an event as email
 @param IEvent $event
 @param int    $latestSendTime Activity $timestamp + batch setting of $affectedUser
 @return bool
Send an event as email @param IEvent $event @param int $latestSendTime Activity $timestamp + batch setting of $affectedUser @return bool
// store in DB