> For the complete documentation index, see [llms.txt](https://docs.norrnext.com/norrcompetition/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.norrnext.com/norrcompetition/customisation/events/entry.md).

# Entry

Participant entry events cover the entire lifecycle of contest submissions — including moderation, display, approval, state transitions, voting limits, and database transactions.

***

### `onParticipantDisplay`

* **Event Class:** `\NorrNext\Component\Competition\Administrator\Event\Display\ParticipantDisplayEvent`
* **Context:** `com_competition.participant`
* **Triggered In:** Frontend Entry view (`site/src/View/Participant/HtmlView.php`)

#### Description

Fired when an entry page is initialized for rendering, allowing plugins to inspect or enrich the entry object.

```php
use NorrNext\Component\Competition\Administrator\Event\Display\ParticipantDisplayEvent;

public function onParticipantDisplay(ParticipantDisplayEvent $event): void
{
    $context = $event->getContext(); // 'com_competition.participant'
    $entry   = $event->getItem();    // Entry entity object
}
```

***

### `onParticipantBeforeSave`

* **Event Class:** `\NorrNext\Component\Competition\Administrator\Event\Model\BeforeSaveEvent`
* **Context:** `com_competition.participant` or `com_competition.appform`
* **Triggered In:** `ParticipantModel::save()` (admin) and `AppformModel::saveParticipant()` (site)
* **Cancellable:** Yes (returning `false` aborts the save)

#### Description

Triggered inside the active transaction before saving the participant record. Returning `false` rolls back the transaction.

```php
use NorrNext\Component\Competition\Administrator\Event\Model\BeforeSaveEvent;

public function onParticipantBeforeSave(BeforeSaveEvent $event): bool
{
    $table = $event->getItem();  // Participant table object
    $isNew = $event->getIsNew(); // bool

    return true;
}
```

***

### `onParticipantAfterSave`

* **Event Class:** `\NorrNext\Component\Competition\Administrator\Event\Model\AfterSaveEvent`
* **Context:** `com_competition.participant` or `com_competition.appform`
* **Triggered In:** `ParticipantModel::save()` (admin) and `AppformModel::saveParticipant()` (site)

#### Description

Triggered inside the transaction immediately after saving the participant record.

```php
use NorrNext\Component\Competition\Administrator\Event\Model\AfterSaveEvent;

public function onParticipantAfterSave(AfterSaveEvent $event): void
{
    $table = $event->getItem();
    $isNew = $event->getIsNew();
}
```

***

### `onParticipantBeforeSaveTransactionCommit`

* **Event Class:** `\NorrNext\Component\Competition\Administrator\Event\Model\BeforeTransactionCommitEvent`
* **Context:** `com_competition.participant`
* **Triggered In:** `ParticipantModel::save()` (admin)
* **Cancellable:** Yes (returning `false` aborts the transaction)

#### Description

Triggered right before committing the database transaction. Returning `false` rolls back all changes made during the save.

```php
use NorrNext\Component\Competition\Administrator\Event\Model\BeforeTransactionCommitEvent;

public function onParticipantBeforeSaveTransactionCommit(BeforeTransactionCommitEvent $event): bool
{
    $data  = $event->getData();  // Validated form data array
    $isNew = $event->getIsNew(); // bool

    return true;
}
```

***

### `onParticipantAfterSaveTransactionCommit`

* **Event Class:** `\NorrNext\Component\Competition\Administrator\Event\Model\AfterTransactionCommitEvent`
* **Context:** `com_competition.participant`
* **Triggered In:** `ParticipantModel::save()` (admin)

#### Description

Triggered after the database transaction has successfully committed. Guaranteed that all entry data is persisted in the database.

```php
use NorrNext\Component\Competition\Administrator\Event\Model\AfterTransactionCommitEvent;

public function onParticipantAfterSaveTransactionCommit(AfterTransactionCommitEvent $event): void
{
    $data  = $event->getData();
    $isNew = $event->getIsNew();
}
```

***

### `onParticipantBeforeDelete`

* **Event Class:** `\NorrNext\Component\Competition\Administrator\Event\Model\BeforeDeleteEvent`
* **Context:** `com_competition.participant`
* **Triggered In:** `ParticipantModel::delete()` (admin)
* **Cancellable:** Yes (returning `false` aborts deletion)

```php
use NorrNext\Component\Competition\Administrator\Event\Model\BeforeDeleteEvent;

public function onParticipantBeforeDelete(BeforeDeleteEvent $event): bool
{
    $table = $event->getItem();
    return true;
}
```

***

### `onParticipantAfterDelete`

* **Event Class:** `\NorrNext\Component\Competition\Administrator\Event\Model\AfterDeleteEvent`
* **Context:** `com_competition.participant`
* **Triggered In:** `ParticipantModel::delete()` (admin)

```php
use NorrNext\Component\Competition\Administrator\Event\Model\AfterDeleteEvent;

public function onParticipantAfterDelete(AfterDeleteEvent $event): void
{
    $table = $event->getItem();
}
```

***

### `onParticipantAllowedCompetitionVotes`

* **Event Class:** `\NorrNext\Component\Competition\Administrator\Event\Participant\AllowedVotesEvent`
* **Context:** `com_competition.participant`
* **Triggered In:** `ParticipantModel::getVoteData()` (site)

#### Description

Allows plugins to dynamically modify the maximum allowed votes a user can cast across the entire contest.

```php
use NorrNext\Component\Competition\Administrator\Event\Participant\AllowedVotesEvent;

public function onParticipantAllowedCompetitionVotes(AllowedVotesEvent $event): void
{
    $participantId = $event->getParticipantId();
    $contest       = $event->getCompetition();
    $currentLimit  = $event->getAllowedVotes();

    // Grant 3 extra votes to subscribers
    $event->setArgument('allowedVotes', $currentLimit + 3);
}
```

***

### `onParticipantAllowedParticipantVotes`

* **Event Class:** `\NorrNext\Component\Competition\Administrator\Event\Participant\AllowedVotesEvent`
* **Context:** `com_competition.participant`
* **Triggered In:** `ParticipantModel::getVoteData()` (site)

#### Description

Allows plugins to dynamically modify the maximum allowed votes a user can cast for a specific participant entry.

```php
use NorrNext\Component\Competition\Administrator\Event\Participant\AllowedVotesEvent;

public function onParticipantAllowedParticipantVotes(AllowedVotesEvent $event): void
{
    $participantId = $event->getParticipantId();
    $contest       = $event->getCompetition();

    $event->setArgument('allowedVotes', 1);
}
```

***

### `onParticipantCheckVotePeriod`

* **Event Class:** `\NorrNext\Component\Competition\Administrator\Event\Participant\CheckVotePeriodEvent`
* **Context:** `com_competition.participant`
* **Triggered In:** `ParticipantModel::getVoteData()` (site)
* **Cancellable:** Yes (returning `false` cancels period enforcement)

#### Description

Fired before enforcing the configured voting frequency cooldown period (e.g. 1 vote per 24 hours). Returning `false` bypasses the cooldown check, allowing an immediate vote.

```php
use NorrNext\Component\Competition\Administrator\Event\Participant\CheckVotePeriodEvent;

public function onParticipantCheckVotePeriod(CheckVotePeriodEvent $event): bool
{
    $participantId = $event->getParticipantId();
    $contest       = $event->getCompetition();

    // Return false to bypass cooldown restriction for specific VIP users
    return false;
}
```

***

### `onParticipantBeforeVoteSave`

* **Event Class:** `\NorrNext\Component\Competition\Administrator\Event\Vote\BeforeVoteSaveEvent`
* **Context:** `com_competition.participant`
* **Triggered In:** `ParticipantModel::vote()` (site)
* **Cancellable:** Yes (returning `false` aborts the vote)

#### Description

Fired before saving a new vote record to the database. Returning `false` cancels the vote.

```php
use NorrNext\Component\Competition\Administrator\Event\Vote\BeforeVoteSaveEvent;

public function onParticipantBeforeVoteSave(BeforeVoteSaveEvent $event): bool
{
    $voteTable = $event->getItem();
    $params    = $event->getParams();

    return true;
}
```

***

### `onParticipantAfterVoteSave`

* **Event Class:** `\NorrNext\Component\Competition\Administrator\Event\Vote\AfterVoteSaveEvent`
* **Context:** `com_competition.participant`
* **Triggered In:** `ParticipantModel::vote()` (site)

#### Description

Fired immediately after a vote is saved in the database table.

```php
use NorrNext\Component\Competition\Administrator\Event\Vote\AfterVoteSaveEvent;

public function onParticipantAfterVoteSave(AfterVoteSaveEvent $event): void
{
    $voteTable = $event->getItem();
    $params    = $event->getParams();
}
```

***

### `onParticipantBeforeChangeState`

* **Event Class:** `\NorrNext\Component\Competition\Administrator\Event\Participant\BeforeChangeStateEvent`
* **Context:** `com_competition.participant`
* **Triggered In:** `ParticipantModel::publish()` (admin)

#### Description

Allows plugins to filter or modify the list of entry IDs before their published state changes.

```php
use NorrNext\Component\Competition\Administrator\Event\Participant\BeforeChangeStateEvent;

public function onParticipantBeforeChangeState(BeforeChangeStateEvent $event): void
{
    $pks   = $event->getPks();   // array of primary keys
    $value = $event->getValue(); // 1 = Published, 0 = Unpublished, -2 = Trashed

    // Remove any protected IDs from $pks and update the event
    // $event->setArgument('pks', $filteredPks);
}
```

***

### `onParticipantChangeState`

* **Context:** `com_competition.participant`
* **Triggered In:** `ParticipantModel::publish()` (admin)

#### Description

Fired after entries have had their published state updated.

```php
use Joomla\Event\Event;

public function onParticipantChangeState(Event $event): void
{
    $context = $event->getArgument('context');
    $pks     = $event->getArgument('pks', []);
    $value   = $event->getArgument('value');
}
```

***

### `onParticipantBeforeApprove`

* **Event Class:** `\NorrNext\Component\Competition\Administrator\Event\Participant\BeforeApproveEvent`
* **Context:** `com_competition.participant`
* **Triggered In:** `ParticipantModel::approve()` (admin)

#### Description

Fired before updating entry approval statuses. Plugins can inspect or alter the list of participant IDs being approved.

```php
use NorrNext\Component\Competition\Administrator\Event\Participant\BeforeApproveEvent;

public function onParticipantBeforeApprove(BeforeApproveEvent $event): void
{
    $ids   = $event->getIds();   // array of IDs
    $value = $event->getValue(); // 1 = Approved, 0 = Unapproved
}
```

***

### `onParticipantApprove`

* **Event Class:** `\NorrNext\Component\Competition\Administrator\Event\Participant\ApproveEvent`
* **Context:** `com_competition.participant`
* **Triggered In:** `ParticipantModel::approve()` (admin)

#### Description

Fired after entry approval statuses have been saved. Used by notification and points plugins to dispatch emails and award user points upon approval.

```php
use NorrNext\Component\Competition\Administrator\Event\Participant\ApproveEvent;

public function onParticipantApprove(ApproveEvent $event): void
{
    $ids   = $event->getIds();   // array of IDs
    $value = $event->getValue(); // 1 = Approved, 0 = Unapproved
}
```
