> 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/contest.md).

# Contest

### onCompetitionDisplay

**Description**\
This event is triggered in `CompetitionViewCompetition::display` (site).

```php
public function onCompetitionDisplay($context, $item)
{
    // Do something
}
```

**Arguments**\
`$context` - the context of the event, ‘com\_competition.competition’.\
`$item` - the contest object.

### onCompetitionBeforeDelete

### onCompetitionAfterDelete

**Description**\
These plugins are triggered in `CompetitionModelCompetition::delete` (admin). If the plugin returns `false` for `onCompetitionBeforeDelete` event then the contest is not being deleted.

```php
public function onCompetitionAfterDelete($context, $table)
{
    // Do something
    return;
}
```

**Arguments**\
`$context` - the context of the event, ‘com\_competition.competition’.\
`$table` - a reference to CompetitionTableCompetition object.

### onCompetitionBeforeSave

### onCompetitionAfterSave

**Description**\
These events are triggered in `CompetitionModelCompetition::save` (admin). If the plugin returns `false` for `onCompetitionBeforeSave` event then the contest is not being saved to the database.

```php
public function onCompetitionBeforeSave($context, $table, $isNew)
{
    // Do something
    return true;
}
```

**Arguments**\
`$context` - the context of the event, ‘com\_competition.competition’.\
`$table` - a reference to CompetitionTableCompetition object.\
`$isNew` - true for new contest, false otherwise./

### onCompetitionChangeState

**Description**\
Is triggered in `CompetitionModelCompetition::publish` (admin) after field has its state changed.

```php
public function onCompetitionChangeState($context, $pks, $value)
{
    // Do something
    return;
}
```

**Arguments**\
`$context` - the context of the event, ‘com\_competition.competition’.\
`$pks` - a list of the primary keys to change.\
`$value` - the value of the state: -2 - deleted; 0 - unpublished; 1 - published.<br>
