Entities/Permissions/Model/PermissionsTableMapper.php
public function getChangedFields(array $changedFields): array 
    {
        $changedPermissionFields = [];

        foreach ($changedFields as $fieldName => $fieldInfo) {
            if (in_array($fieldName, self::UPDATE_FIELDS)) {
                switch($fieldName) {
                    case 'active':
                        $changedPermissionFields['active'] = Postgres::convertBoolToPostgresBool($changedFields['active']);
                        break;

                    default:
                        $changedPermissionFields[$fieldName] = $changedFields[$fieldName];
                }
            }
        }
        return $changedPermissionFields;
    }
public function getChangedFields(array $changedFields): array 
    {
        $changedPermissionFields = [];

        foreach ($changedFields as $fieldName => $fieldInfo) {
            if (in_array($fieldName, self::UPDATE_FIELDS)) {
                switch($fieldName) {
                    case 'active':
                        $changedPermissionFields['active'] = Postgres::convertBoolToPostgresBool($changedFields['active']);
                        break;

                    default:
                        $changedPermissionFields[$fieldName] = $changedFields[$fieldName];
                }
            }
        }
        return $changedPermissionFields;
    }
public function getChangedFields ( array $ changedFields ) : array { $ changedPermissionFields = [ ] ; foreach ( $ changedFields as $ fieldName => $ fieldInfo ) { if ( in_array ( $ fieldName , self :: UPDATE_FIELDS ) ) { switch ( $ fieldName ) { case 'active' : $ changedPermissionFields [ 'active' ] = Postgres :: convertBoolToPostgresBool ( $ changedFields [ 'active' ] ) ; break ; default : $ changedPermissionFields [ $ fieldName ] = $ changedFields [ $ fieldName ] ; } } } return $ changedPermissionFields ; }
note this allows any fields to be passed in changedFields and returns only changes from the UPDATE_FIELDS array
note this allows any fields to be passed in changedFields and returns only changes from the UPDATE_FIELDS array