Menu

## EventsContract

EventsContract.php : 14

### Table of Contents

#### Methods

getItem() : null|object
  Override this in your service to define the basis to return single item details
getItems() : null|object
  Override this in your service to define the basis to return multiple items from the database
getJoinQuery() : null|object
  Override this in your service to define the basis to return multiple items from the database
postCreate() : object|array<string|int, mixed>|null
  This method is post create action, use it to perform any action after saving.
postDelete() : mixed
  This method is called before the delete action. Use it to perform any action before deleting.
postUpdate() : object|array<string|int, mixed>|null
  This method is post create action, use it to perform any action after saving.
preCreate() : array<string|int, mixed>|bool|null
  This method is called before the create action, use it to transform the data before saving.
preDelete() : array<string|int, mixed>|null|object|bool
  This method is called before the delete action. Use it to perform any action before deleting.
preUpdate() : array<string|int, mixed>|bool|null
  This method is called before the create action, use it to transform the data before saving.

### Methods

#### getItem()

EventsContract.php : 100

Override this in your service to define the basis to return single item details

`public getItem() : null|object`

##### Return values

null|object

#### getItems()

EventsContract.php : 109

Override this in your service to define the basis to return multiple items from the database

`public getItems() : null|object`

##### Return values

null|object

#### getJoinQuery()

EventsContract.php : 118

Override this in your service to define the basis to return multiple items from the database

`public getJoinQuery() : null|object`

##### Return values

null|object

#### postCreate()

EventsContract.php : 63

This method is post create action, use it to perform any action after saving.

`public postCreate([array<string|int, mixed>|object|null $createdItem = null ]) : object|array<string|int, mixed>|null`

You have access to the data being created in the `$this->request->getData()` method

Whatever is returned here is what is returned to the user

##### Parameters

$createdItem : array<string|int, mixed>|object|null = null

##### Return values

object|array<string|int, mixed>|null

#### postDelete()

EventsContract.php : 90

This method is called before the delete action. Use it to perform any action before deleting.

`public postDelete(PDOStatement $deleteInstance[, array<string|int, mixed>|null|object $deletedItem = null ]) : mixed`

You have access to the data being updated in the `$this->request->getData()` method

This has no effect on the delete action. Since it is called after the delete action.

Whatever is returned here is what is returned to the user

##### Parameters

$deleteInstance : PDOStatement
$deletedItem : array<string|int, mixed>|null|object = null

#### postUpdate()

EventsContract.php : 75

This method is post create action, use it to perform any action after saving.

`public postUpdate([array<string|int, mixed>|object|null $updatedItem = null ]) : object|array<string|int, mixed>|null`

You have access to the data being created in the `$this->request->getData()` method

Whatever is returned here is what is returned to the user

##### Parameters

$updatedItem : array<string|int, mixed>|object|null = null

##### Return values

object|array<string|int, mixed>|null

#### preCreate()

EventsContract.php : 39

This method is called before the create action, use it to transform the data before saving.

`public preCreate([array<string|int, mixed>|null $createItem = null ]) : array<string|int, mixed>|bool|null`

You have access to the data being created in the `$this->request->getData()` method

Return false, null or throw an exception to stop the create action.

##### Parameters

$createItem : array<string|int, mixed>|null = null

  The data being created - You can modify this data before saving. Return false or null to stop the create action

##### Return values

array<string|int, mixed>|bool|null

#### preDelete()

EventsContract.php : 51

This method is called before the delete action. Use it to perform any action before deleting.

`public preDelete([array<string|int, mixed>|null|object $itemToDelete = null ]) : array<string|int, mixed>|null|object|bool`

You have access to the data being updated in the `$this->request->getData()` method

Return false, null or throw an exception to stop the delete action.

##### Parameters

$itemToDelete : array<string|int, mixed>|null|object = null

##### Return values

array<string|int, mixed>|null|object|bool

#### preUpdate()

EventsContract.php : 26

This method is called before the create action, use it to transform the data before saving.

`public preUpdate([array<string|int, mixed>|null $updateItem = null ]) : array<string|int, mixed>|bool|null`

You have access to the object being updated $updateItem

Return false, null or raise any exception to stop the update action.

##### Parameters

$updateItem : array<string|int, mixed>|null = null

  The data being updated - You can modify this data before saving

##### Return values

array<string|int, mixed>|bool|null —

The return data is what is saved to the database, if false or null, the update action is aborted

## Search results