Interface StorableInterface
Storable items can be stored and loaded from a Source.
Methods summary
public
Charcoal\Source\StorableInterface
|
#
setId( mixed $id )
Set the object's ID. The actual property set depends on key()
Set the object's ID. The actual property set depends on key()
Parameters
Returns
|
public
mixed
|
#
id( )
Get the object's (unique) ID. The actualy property get depends on key()
Get the object's (unique) ID. The actualy property get depends on key()
Returns
mixed
|
public
Charcoal\Source\StorableInterface
|
#
setKey( string $key )
Set the key property.
Parameters
Returns
|
public
string
|
#
key( )
Get the key property.
Returns
string
|
public
Charcoal\Source\SourceInterface
|
#
source( )
Get the object's source.
Returns
|
public
boolean
|
#
load( mixed $id )
Load an object from the database from its ID.
Load an object from the database from its ID.
Parameters
- $id
- The ID of the object to load.
Returns
boolean Success / Failure
|
public
Charcoal\Source\StorableInterface
|
#
loadFrom( string $key = null, mixed $value = null )
Load an object from the database from its key $key.
Load an object from the database from its key $key.
Parameters
- $key
- Key pointing a column's name.
- $value
- Value of said column.
Returns
|
public
Charcoal\Source\StorableInterface
|
#
loadFromQuery( string $query, array $binds = [] )
Load an object from the database from a custom SQL query.
Load an object from the database from a custom SQL query.
Parameters
- $query
- The SQL query.
- $binds
- Optional. The SQL query parameters.
Returns
|
public
boolean
|
#
save( )
Save an object current state to storage
Save an object current state to storage
Returns
boolean
|
public
boolean
|
#
update( array $keys = null )
Update the object in storage to the current object state.
Update the object in storage to the current object state.
Parameters
- $keys
- If set, only update the properties specified in this array.
Returns
boolean
|
public
boolean
|
#
delete( )
Delete an object from storage.
Delete an object from storage.
Returns
boolean
|