$id
$id : mixed
Full implementation, as trait, of the StorableInterface
$source : \Charcoal\Source\SourceInterface
setId(mixed $id) : \Charcoal\Source\StorableInterface
Set the object's ID. The actual property set depends on `key()`
mixed | $id | The object id (identifier / primary key value). |
If the argument is not scalar.
Chainable
setKey(string $key) : \Charcoal\Source\StorableInterface
Set the key property.
string | $key | The object key, or identifier "name". |
If the argument is not scalar.
Chainable
setSource(\Charcoal\Source\SourceInterface $source) : \Charcoal\Source\StorableInterface
Set the object's source.
\Charcoal\Source\SourceInterface | $source | The storable object's source. |
Chainable
source() : \Charcoal\Source\SourceInterface
Get the object's source.
load(mixed $id = null) : \Charcoal\Source\StorableInterface
Load an object from the database from its ID.
mixed | $id | The identifier to load. |
Chainable
loadFrom(string $key = null, mixed $value = null) : \Charcoal\Source\StorableInterface
Load an object from the database from its key $key.
string | $key | Key pointing a column's name. |
mixed | $value | Value of said column. |
Chainable.
loadFromQuery(string $query, array $binds = array()) : \Charcoal\Source\StorableInterface
Load an object from the database from a custom SQL query.
string | $query | The SQL query. |
array | $binds | Optional. The SQL query parameters. |
Chainable.
setSourceFactory(\Charcoal\Factory\FactoryInterface $factory) : \Charcoal\Source\StorableInterface
\Charcoal\Factory\FactoryInterface | $factory | The source factory, which is useful to create source. |
Chainable
createSource() : \Charcoal\Source\SourceInterface
Create the model's source, with the Source Factory.