Skip to content
Snippets Groups Projects
Unverified Commit 29d21638 authored by Seamus Lee's avatar Seamus Lee Committed by GitHub
Browse files

Merge pull request #21572 from colemanw/afformEvents

Afform - Add getters/setters to the AfformSubmitEvent class
parents 7f452b35 80ff12c2
Branches
Tags
No related merge requests found
......@@ -107,6 +107,33 @@ class AfformSubmitEvent extends AfformBaseEvent {
return $this;
}
/**
* Get the id of a saved record
* @param int $index
* @return mixed
*/
public function getEntityId(int $index = 0) {
$idField = CoreUtil::getIdFieldName($this->entityName);
return $this->entityIds[$this->entityName][$index][$idField] ?? NULL;
}
/**
* Get records to be saved
* @return array
*/
public function getRecords(): array {
return $this->records;
}
/**
* @param array $records
* @return $this
*/
public function setRecords(array $records) {
$this->records = $records;
return $this;
}
/**
* @param int $index
* @param string $joinEntity
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment