CodeIgniter v4.6 API

DataException extends RuntimeException
in package
implements ExceptionInterface uses DebugTraceableTrait

Exception thrown if an error which can only be found on runtime occurs.

Table of Contents

Interfaces

ExceptionInterface
Provides a domain-level interface for broad capture of all database-related exceptions.

Methods

__construct()  : mixed
Tweaks the exception's constructor to assign the file/line to where it is actually raised rather than were it is instantiated.
forEmptyDataset()  : DataException
Used by Model's insert/update methods when there isn't any data to actually work with.
forEmptyInputGiven()  : DataException
forEmptyPrimaryKey()  : DataException
Used by Model's insert/update methods when there is no primary key defined and Model has option `useAutoIncrement` set to false.
forFindColumnHaveMultipleColumns()  : DataException
forInvalidAllowedFields()  : DataException
forInvalidArgument()  : DataException
Thrown when an argument for one of the Model's methods were empty or otherwise invalid, and they could not be to work correctly for that method.
forInvalidMethodTriggered()  : DataException
Used by the Model's trigger() method when the callback cannot be found.
forTableNotFound()  : DataException

Methods

__construct()

Tweaks the exception's constructor to assign the file/line to where it is actually raised rather than were it is instantiated.

public final __construct([string $message = '' ][, int $code = 0 ][, Throwable|null $previous = null ]) : mixed
Parameters
$message : string = ''
$code : int = 0
$previous : Throwable|null = null

forEmptyDataset()

Used by Model's insert/update methods when there isn't any data to actually work with.

public static forEmptyDataset(string $mode) : DataException
Parameters
$mode : string
Return values
DataException

forEmptyPrimaryKey()

Used by Model's insert/update methods when there is no primary key defined and Model has option `useAutoIncrement` set to false.

public static forEmptyPrimaryKey(string $mode) : DataException
Parameters
$mode : string
Return values
DataException

forInvalidArgument()

Thrown when an argument for one of the Model's methods were empty or otherwise invalid, and they could not be to work correctly for that method.

public static forInvalidArgument(string $argument) : DataException
Parameters
$argument : string
Return values
DataException

forInvalidMethodTriggered()

Used by the Model's trigger() method when the callback cannot be found.

public static forInvalidMethodTriggered(string $method) : DataException
Parameters
$method : string
Return values
DataException

        
On this page

Search results