You are here

public function Activity::addParticipant in CRM Core 8

Same name and namespace in other branches
  1. 8.3 modules/crm_core_activity/src/Entity/Activity.php \Drupal\crm_core_activity\Entity\Activity::addParticipant()
  2. 8.2 modules/crm_core_activity/src/Entity/Activity.php \Drupal\crm_core_activity\Entity\Activity::addParticipant()

Add a participant to the activity.

Parameters

\Drupal\crm_core_contact\ContactInterface $contact: The contact to add as a participant.

Return value

$this

Overrides ActivityInterface::addParticipant

File

modules/crm_core_activity/src/Entity/Activity.php, line 195

Class

Activity
CRM Activity Entity Class.

Namespace

Drupal\crm_core_activity\Entity

Code

public function addParticipant(ContactInterface $contact) {
  $this
    ->get('activity_participants')
    ->appendItem($contact);
}