\AdventureRes\Models AdventureResModelInterface

Interface AdventureResModelInterface

Summary

Methods
Constants
populateModel()
getAttributeNames()
getAttributes()
getAttribute()
setAttribute()
isValid()
clearErrors()
hasErrors()
getErrors()
getErrorsAsString()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

populateModel()

populateModel(array  $attributes) : \AdventureRes\Models\AbstractAdventureResModel

Populates a new model instance with a given set of attributes.

Parameters

array $attributes

An array of attributes and values to populate into the model.

Returns

\AdventureRes\Models\AbstractAdventureResModel

getAttributeNames()

getAttributeNames() : array

Returns the list of the model's attribute names.

Returns

array

getAttributes()

getAttributes() : array

Returns an array of attributes and their assigned values of an instance of the model.

Throws

\AdventureRes\Exceptions\AdventureResModelException

Returns

array

getAttribute()

getAttribute(string  $name) : mixed

Returns the value for a specified attribute of an instance of the model.

Parameters

string $name

Throws

\AdventureRes\Exceptions\AdventureResModelException

Returns

mixed

setAttribute()

setAttribute(string  $name, mixed  $value) 

Sets a value for a specified attribute on the instance of the model.

Parameters

string $name
mixed $value

Throws

\AdventureRes\Exceptions\AdventureResModelException

isValid()

isValid() : boolean

Runs a validation check to see if the model instance is valid.

Throws

\AdventureRes\Exceptions\AdventureResModelException

Returns

boolean

clearErrors()

clearErrors(string|null  $attributeName = null) 

Removes errors for all attributes or a single attribute.

Parameters

string|null $attributeName

hasErrors()

hasErrors() : boolean

Determines if the model instance contains errors.

Returns

boolean

getErrors()

getErrors() : array|null

Returns an array of errors from the model instance.

Returns

array|null

getErrorsAsString()

getErrorsAsString() : array|null

Returns all errors as a string.

Returns

array|null