\Cake\ORM\ExceptionPersistenceFailedException

Used when a strict save or delete fails

Summary

Methods
Properties
Constants
__construct()
getAttributes()
responseHeader()
getEntity()
No public properties found
No constants found
buildError()
$_attributes
$_messageTemplate
$_responseHeaders
$_defaultCode
$_entity
N/A
No private methods found
No private properties found
N/A

Properties

$_attributes

$_attributes : array

Array of attributes that are passed in from the constructor, and made available in the view when a development error is displayed.

Type

array

$_messageTemplate

$_messageTemplate : string

Template string that has attributes sprintf()'ed into it.

Type

string

$_responseHeaders

$_responseHeaders : array|null

Array of headers to be passed to Cake\Http\Response::header()

Type

array|null

$_defaultCode

$_defaultCode : integer

Default exception code

Type

integer

Methods

__construct()

__construct(\Cake\Datasource\EntityInterface  $entity, string|array  $message, integer  $code = null, \Exception|null  $previous = null) 

Constructor.

Allows you to create exceptions that are treated as framework errors and disabled when debug = 0.

Parameters

\Cake\Datasource\EntityInterface $entity

The entity on which the persistence operation failed

string|array $message

Either the string of the error message, or an array of attributes that are made available in the view, and sprintf()'d into Exception::$_messageTemplate

integer $code

The code of the error, is also the HTTP status code for the error.

\Exception|null $previous

the previous exception.

getAttributes()

getAttributes() : array

Get the passed in attributes

Returns

array

responseHeader()

responseHeader(string|array|null  $header = null, string|null  $value = null) : array

Get/set the response header to be used

See also Cake\Http\Response::withHeader()

Parameters

string|array|null $header

An array of header strings or a single header string

  • an associative array of "header name" => "header value"
  • an array of string headers is also accepted (deprecated)
string|null $value

The header value.

Returns

array

buildError()

buildError(string|array  $error) : string

Parameters

string|array $error

Error message.

Returns

string