Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'setModuleValidatorArchiveConnections' Hook #5

Merged
merged 1 commit into from
Feb 29, 2024

Conversation

zoglo
Copy link
Member

@zoglo zoglo commented Feb 28, 2024

Adds a hook to easily implement archive connection validations

Usage:

// Register Hook
$GLOBALS['PI_HOOKS']['setModuleValidatorArchiveConnections'][] = [YourListener::class, 'setArchiveConnections'];

// Your listener method
public function setArchivesConnections(array $row): array
{
    return match ($row['type']) {
        'moduletype' => ['field' => 'archives_field', 'table' => YourArchiveModel::getTable()],
        default => [],
    };
}

@zoglo zoglo added the enhancement New feature or request label Feb 28, 2024
@zoglo zoglo requested review from doishub and eki89 and removed request for doishub February 28, 2024 15:19
@eki89 eki89 merged commit c7904a4 into main Feb 29, 2024
@eki89 eki89 deleted the feature/archiveConnectionHook branch February 29, 2024 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants