Overview

Namespaces

  • Charcoal
    • Loader
    • Model
      • Service
      • ServiceProvider
    • Source
      • Database
    • Validator

Classes

  • AbstractSource
  • DatabaseSource
  • DatabaseSourceConfig
  • Filter
  • Order
  • Pagination
  • SourceConfig

Interfaces

  • DatabaseSourceInterface
  • FilterInterface
  • OrderInterface
  • PaginationInterface
  • SourceInterface
  • StorableInterface

Traits

  • StorableTrait
  • Overview
  • Namespace
  • Class

Interface StorableInterface

Storable items can be stored and loaded from a Source.

Direct known implementers

Charcoal\Model\AbstractModel

Indirect known implementers

Charcoal\Model\Model
Namespace: Charcoal\Source
Located at Charcoal/Source/StorableInterface.php
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

$id
The object's ID.

Returns

Charcoal\Source\StorableInterface
Chainable
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.

Set the key property.

Parameters

$key
The object's key.

Returns

Charcoal\Source\StorableInterface
Chainable
public string
# key( )

Get the key property.

Get the key property.

Returns

string
public Charcoal\Source\SourceInterface
# source( )

Get the object's source.

Get the object's source.

Returns

Charcoal\Source\SourceInterface
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

Charcoal\Source\StorableInterface
Chainable.
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

Charcoal\Source\StorableInterface
Chainable.
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
API documentation generated by ApiGen