Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
3 / 3 |
|
100.00% |
3 / 3 |
CRAP | |
100.00% |
1 / 1 |
| CrmUserContactEvent | |
100.00% |
3 / 3 |
|
100.00% |
3 / 3 |
3 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getCrmUserContact | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setCrmUserContact | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace Drupal\crm\Event; |
| 4 | |
| 5 | use Drupal\Component\EventDispatcher\Event; |
| 6 | use Drupal\crm\CrmUserContactInterface; |
| 7 | |
| 8 | /** |
| 9 | * Event that is fired when a user is created, and auto create is enabled. |
| 10 | */ |
| 11 | class CrmUserContactEvent extends Event { |
| 12 | |
| 13 | /** |
| 14 | * The event name. |
| 15 | * |
| 16 | * @var string |
| 17 | */ |
| 18 | const EVENT_NAME = 'crm_user_contact_event'; |
| 19 | |
| 20 | |
| 21 | /** |
| 22 | * The crm user contact. |
| 23 | * |
| 24 | * @var \Drupal\crm\CrmUserContactInterface |
| 25 | */ |
| 26 | protected $crmUserContact; |
| 27 | |
| 28 | /** |
| 29 | * Constructs a new CrmUserContactEvent. |
| 30 | * |
| 31 | * @param \Drupal\crm\CrmUserContactInterface $crm_user_contact |
| 32 | * The crm user contact. |
| 33 | */ |
| 34 | public function __construct(CrmUserContactInterface $crm_user_contact) { |
| 35 | $this->crmUserContact = $crm_user_contact; |
| 36 | } |
| 37 | |
| 38 | /** |
| 39 | * Get the crm user contact. |
| 40 | * |
| 41 | * @return \Drupal\crm\CrmUserContactInterface |
| 42 | * The crm user contact. |
| 43 | */ |
| 44 | public function getCrmUserContact(): CrmUserContactInterface { |
| 45 | return $this->crmUserContact; |
| 46 | } |
| 47 | |
| 48 | /** |
| 49 | * Set the crm user contact. |
| 50 | * |
| 51 | * @param \Drupal\crm\CrmUserContactInterface $crm_user_contact |
| 52 | * The crm user contact. |
| 53 | */ |
| 54 | public function setCrmUserContact(CrmUserContactInterface $crm_user_contact): void { |
| 55 | $this->crmUserContact = $crm_user_contact; |
| 56 | } |
| 57 | |
| 58 | } |