Skip to content

Commit

Permalink
Rename saveAttributes method to saveAttributeCollectorPetitionAttributes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ioannis committed Feb 24, 2025
1 parent e6ea40b commit c015b98
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public function hydrate(int $id, \App\Model\Entity\Petition $petition): bool

// Save the Person Role
$personRoleObj = TableRegistry::getTableLocator()->get('PersonRoles');
$role = $personRoleObj->saveAttributes((int)$person->id, $fieldsForPersonRole);
$role = $personRoleObj->saveAttributeCollectorPetitionAttributes((int)$person->id, $fieldsForPersonRole);

/********* MVEAS **************/
// Filter the MVEAS Attributes and keep the field name
Expand Down Expand Up @@ -218,7 +218,7 @@ public function hydrate(int $id, \App\Model\Entity\Petition $petition): bool
return in_array($attr['enrollment_attribute']['attribute'], $personAttributes);
})->toArray();

$People->saveAttributes($person->id, $fieldsForPerson);
$People->saveAttributeCollectorPetitionAttributes($person->id, $fieldsForPerson);

/****** GROUP ******/
// Filter the MVEAS Attributes and keep the field name
Expand All @@ -233,7 +233,7 @@ public function hydrate(int $id, \App\Model\Entity\Petition $petition): bool
})->toArray();

$groupMemberObj = TableRegistry::getTableLocator()->get('GroupMembers');
$groupMemberObj->saveAttributes($person->id, $fieldsForGroup);
$groupMemberObj->saveAttributeCollectorPetitionAttributes($person->id, $fieldsForGroup);

// Save the Date Of Birth. This is the only one that is single valued
// and goes under the Person
Expand Down Expand Up @@ -293,7 +293,7 @@ protected function handleMveaAttributes(
$mveaModel = $supportedAttributes[$attribute]['mveaModel'];

$modelObj = TableRegistry::getTableLocator()->get($mveaModel);
$modelObj->saveAttributes((int)$person->id, $role?->id, $mveaParent, $fieldsForAttribute);
$modelObj->saveAttributeCollectorPetitionAttributes((int)$person->id, $role?->id, $mveaParent, $fieldsForAttribute);
}
}

Expand Down
2 changes: 1 addition & 1 deletion app/src/Model/Table/AdHocAttributesTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public function validationDefault(Validator $validator): Validator {
* @throws \InvalidArgumentException Thrown if required parameters are missing or invalid
* @throws \Cake\ORM\Exception\PersistenceFailedException If saving the entity fails
*/
public function saveAttributes(int $personId, ?int $roleId, string $parentModel, array $fields): bool
public function saveAttributeCollectorPetitionAttributes(int $personId, ?int $roleId, string $parentModel, array $fields): bool
{
foreach ($fields as $idx => $field) {
// Check if this has already been saved
Expand Down
2 changes: 1 addition & 1 deletion app/src/Model/Table/AddressesTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ public function getPermittedFields(): array {
* @throws \InvalidArgumentException If required parameters are missing
* @throws \Cake\ORM\Exception\PersistenceFailedException If the entity could not be saved
*/
public function saveAttributes(int $personId, ?int $roleId, string $parentModel, array $fields): bool
public function saveAttributeCollectorPetitionAttributes(int $personId, ?int $roleId, string $parentModel, array $fields): bool
{
$address = [];

Expand Down
2 changes: 1 addition & 1 deletion app/src/Model/Table/EmailAddressesTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ public function validationDefault(Validator $validator): Validator {
* @throws \Cake\Datasource\Exception\RecordNotFoundException
* @throws \Cake\ORM\Exception\PersistenceFailedException
*/
public function saveAttributes(int $personId, ?int $roleId, string $parentModel, array $fields): bool
public function saveAttributeCollectorPetitionAttributes(int $personId, ?int $roleId, string $parentModel, array $fields): bool
{
foreach ($fields as $idx => $field) {
// Check if this has already been saved
Expand Down
2 changes: 1 addition & 1 deletion app/src/Model/Table/GroupMembersTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ public function validationDefault(Validator $validator): Validator {
* @return GroupMember The saved entity representing the person's role.
*
*/
public function saveAttributes(int $personId, array $fields): GroupMember
public function saveAttributeCollectorPetitionAttributes(int $personId, array $fields): GroupMember
{
$member = [
'person_id' => $personId,
Expand Down
2 changes: 1 addition & 1 deletion app/src/Model/Table/NamesTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ public function validationDefault(Validator $validator): Validator {
* @return bool Returns true on successful save, throws exception otherwise.
* @throws \Cake\ORM\Exception\PersistenceFailedException If the entity could not be saved.
*/
public function saveAttributes(int $personId, ?int $roleId, string $parentModel, array $fields): bool
public function saveAttributeCollectorPetitionAttributes(int $personId, ?int $roleId, string $parentModel, array $fields): bool
{
$name = [
'person_id' => $personId,
Expand Down
2 changes: 1 addition & 1 deletion app/src/Model/Table/PeopleTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ public function validationDefault(Validator $validator): Validator {
* @return Person The updated person entity after saving.
* @since COmanage Registry v5.1.0
*/
public function saveAttributes(int $personId, array $fields): Person
public function saveAttributeCollectorPetitionAttributes(int $personId, array $fields): Person
{
$person = $this->get($personId);
foreach ($fields as $field) {
Expand Down
2 changes: 1 addition & 1 deletion app/src/Model/Table/PersonRolesTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ public function validationDefault(Validator $validator): Validator {
* @throws \Cake\Datasource\Exception\RecordNotFoundException If an issue occurs during saving
* @since COmanage Registry v5.1.0
*/
public function saveAttributes(int $personId, array $fields): PersonRole
public function saveAttributeCollectorPetitionAttributes(int $personId, array $fields): PersonRole
{
$dateFormat = 'yyyy-MM-dd HH:mm:ss';

Expand Down
2 changes: 1 addition & 1 deletion app/src/Model/Table/PronounsTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public function validationDefault(Validator $validator): Validator {
* @param array $fields Array of attributes to save
* @return bool True on success, false otherwise
*/
public function saveAttributes(int $personId, ?int $roleId, string $parentModel, array $fields): bool
public function saveAttributeCollectorPetitionAttributes(int $personId, ?int $roleId, string $parentModel, array $fields): bool
{
foreach ($fields as $idx => $field) {
// Check if this has already been saved
Expand Down
2 changes: 1 addition & 1 deletion app/src/Model/Table/TelephoneNumbersTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ public function validationDefault(Validator $validator): Validator {
* @throws \Cake\ORM\Exception\PersistenceFailedException If saving the entity fails.
* @since COmanage Registry v5.1.0
*/
public function saveAttributes(int $personId, ?int $roleId, string $parentModel, array $fields): bool
public function saveAttributeCollectorPetitionAttributes(int $personId, ?int $roleId, string $parentModel, array $fields): bool
{
$telephone = [];

Expand Down
2 changes: 1 addition & 1 deletion app/src/Model/Table/UrlsTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public function validationDefault(Validator $validator): Validator {
* @param array $fields Array of attributes to save
* @return bool True on success, false otherwise
*/
public function saveAttributes(int $personId, ?int $roleId, string $parentModel, array $fields): bool
public function saveAttributeCollectorPetitionAttributes(int $personId, ?int $roleId, string $parentModel, array $fields): bool
{
foreach ($fields as $idx => $field) {
// Check if this has already been saved
Expand Down

0 comments on commit c015b98

Please sign in to comment.