You are here

public static function OpignoTinCanApiStatements::statementBaseCreation in Opigno TinCan API 8

Same name and namespace in other branches
  1. 3.x src/OpignoTinCanApiStatements.php \Drupal\opigno_tincan_api\OpignoTinCanApiStatements::statementBaseCreation()

Adds the current user as the actor.

The verb selected in parameter, the object based on the node given in parameter and the timestamp based on the current time.

Parameters

array $verb: Verb.

string $activity_definition_type: The activity definition name and ID. Use TinCanActivityDefinitionTypes.

object $activity_object: Activity.

null|mixed $user: User.

Return value

\TinCan\Statement Statement.

Throws

\Exception

7 calls to OpignoTinCanApiStatements::statementBaseCreation()
OpignoTincanLiveMeeting::createAndSendTincanStatementsForMeeting in modules/opigno_tincan_live_meeting/src/EventSubscriber/OpignoTincanLiveMeeting.php
Sends tincan statements for Live meeting.
opigno_tincan_modules_user_module_status_insert in modules/opigno_tincan_modules/opigno_tincan_modules.module
Implements hook_ENTITY_TYPE_insert().
opigno_tincan_modules_user_module_status_presave in modules/opigno_tincan_modules/opigno_tincan_modules.module
Implements hook_ENTITY_TYPE_presave().
_opigno_tincan_activities_create_and_send_statements in modules/opigno_tincan_activities/opigno_tincan_activities.module
The main function for building tincan statement object for opigno activity.
_opigno_tincan_courses_create_and_send_course_statements in modules/opigno_tincan_courses/opigno_tincan_courses.module
Creates and sends course statements.

... See full list

File

src/OpignoTinCanApiStatements.php, line 287

Class

OpignoTinCanApiStatements
Class OpignoTinCanApiStatements.

Namespace

Drupal\opigno_tincan_api

Code

public static function statementBaseCreation(array $verb, $activity_definition_type, $activity_object, $user = NULL) {

  // _opigno_tincan_api_statement_base_creation.
  $statement = new Statement();
  self::setActor($statement, $user);
  self::setVerb($statement, $verb);
  self::setObjectActivity($statement, $activity_definition_type, $activity_object);
  $statement
    ->stamp();
  return $statement;
}