Add in unit test of the submit action and re-work as per feedback from coleman
[civicrm-core.git] / ext / afform / core / Civi / Afform / Event / AfformSubmitEvent.php
index c4f968c1b9b81f27c6c0ef2f7f8d6ef3de06c7a7..4aa1fa4f051cd5afcaa1b35e46294b41e0964f62 100644 (file)
@@ -55,7 +55,7 @@ class AfformSubmitEvent extends AfformBaseEvent {
    * @param string $entityName
    * @param array $entityIds
    */
-  public function __construct(array $afform, FormDataModel $formDataModel, Submit $apiRequest, $values, string $entityType, string $entityName, array $entityIds) {
+  public function __construct(array $afform, FormDataModel $formDataModel, Submit $apiRequest, $values, string $entityType, string $entityName, array &$entityIds) {
     parent::__construct($afform, $formDataModel, $apiRequest);
     $this->values = $values;
     $this->entityType = $entityType;
@@ -63,4 +63,28 @@ class AfformSubmitEvent extends AfformBaseEvent {
     $this->entityIds = $entityIds;
   }
 
+  /**
+   * Set the entity type associated with this event
+   * @param string $entityType
+   */
+  public function setEntityType(string $entityType): void {
+    $this->entityType = $entityType;
+  }
+
+  /**
+   * Set the values associated with this event
+   * @param array $values
+   */
+  public function setValues(array $values): void {
+    $this->values = $values;
+  }
+
+  /**
+   * Set the entity name associated with this event
+   * @param string $entityName
+   */
+  public function setEntityName(string $entityName): void {
+    $this->entityName = $entityName;
+  }
+
 }