Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
33.33% |
2 / 6 |
|
33.33% |
2 / 6 |
CRAP | |
0.00% |
0 / 1 |
| Company_Updated | |
33.33% |
2 / 6 |
|
33.33% |
2 / 6 |
16.67 | |
0.00% |
0 / 1 |
| get_slug | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| get_title | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| get_description | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| get_category | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| get_data_type | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| listen_to_event | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | /** |
| 3 | * Jetpack CRM Automation Company_Updated trigger. |
| 4 | * |
| 5 | * @package automattic/jetpack-crm |
| 6 | * @since 6.2.0 |
| 7 | */ |
| 8 | |
| 9 | namespace Automattic\Jetpack\CRM\Automation\Triggers; |
| 10 | |
| 11 | use Automattic\Jetpack\CRM\Automation\Base_Trigger; |
| 12 | use Automattic\Jetpack\CRM\Automation\Data_Types\Company_Data; |
| 13 | |
| 14 | /** |
| 15 | * Adds the Company_Updated class. |
| 16 | * |
| 17 | * @since 6.2.0 |
| 18 | */ |
| 19 | class Company_Updated extends Base_Trigger { |
| 20 | |
| 21 | /** |
| 22 | * Get the slug name of the trigger. |
| 23 | * |
| 24 | * @since 6.2.0 |
| 25 | * |
| 26 | * @return string The slug name of the trigger. |
| 27 | */ |
| 28 | public static function get_slug(): string { |
| 29 | return 'jpcrm/company_updated'; |
| 30 | } |
| 31 | |
| 32 | /** |
| 33 | * Get the title of the trigger. |
| 34 | * |
| 35 | * @since 6.2.0 |
| 36 | * |
| 37 | * @return string|nul The title of the trigger. |
| 38 | */ |
| 39 | public static function get_title(): ?string { |
| 40 | return __( 'Company Updated', 'zero-bs-crm' ); |
| 41 | } |
| 42 | |
| 43 | /** |
| 44 | * Get the description of the trigger. |
| 45 | * |
| 46 | * @since 6.2.0 |
| 47 | * |
| 48 | * @return string|null The description of the trigger. |
| 49 | */ |
| 50 | public static function get_description(): ?string { |
| 51 | return __( 'Triggered when a CRM company is updated', 'zero-bs-crm' ); |
| 52 | } |
| 53 | |
| 54 | /** |
| 55 | * Get the category of the trigger. |
| 56 | * |
| 57 | * @since 6.2.0 |
| 58 | * |
| 59 | * @return string|null The category of the trigger. |
| 60 | */ |
| 61 | public static function get_category(): ?string { |
| 62 | return __( 'Company', 'zero-bs-crm' ); |
| 63 | } |
| 64 | |
| 65 | /** |
| 66 | * Get the date type. |
| 67 | * |
| 68 | * @return string The type of the step |
| 69 | */ |
| 70 | public static function get_data_type(): string { |
| 71 | return Company_Data::class; |
| 72 | } |
| 73 | |
| 74 | /** |
| 75 | * Listen to the desired event. |
| 76 | * |
| 77 | * @since 6.2.0 |
| 78 | * |
| 79 | * @return void |
| 80 | */ |
| 81 | protected function listen_to_event(): void { |
| 82 | $this->listen_to_wp_action( 'jpcrm_company_updated' ); |
| 83 | } |
| 84 | } |