Index
A
- Record::associate() — Method in class Record
- Sets the referenced fields in this record to reference the record of the given model.
- Record::addAssociation() — Method in class Record
- Sets the referencing fields in the record of the given model to reference this record.
C
- Connection — Class in namespace Simply\Database\Connection
- Interface for database connections that provide basic query functionality to an SQL database.
- ConnectionProvider — Class in namespace Simply\Database\Connection\Provider
- Interface for objects that can initialize and provide the PDO instance for database connectors.
- Model::createFromDatabaseRecord() — Method in class Model
- Initializes the model with the given database record instead of calling the default constructor.
- $Repository#connection — Property in class Repository
- Schema::createRecord() — Method in class Schema
- Returns a new empty record for the schema.
- Schema::createRecordFromValues() — Method in class Schema
- Returns a new record with the given values for the fields.
- Schema::createRecordFromRow() — Method in class Schema
- Returns a new record with values taken from a result row with optional prefix for fields.
- Schema::createModel() — Method in class Schema
- Returns a new model that is associated to the given record.
- Schema::createModelFromRow() — Method in class Schema
- Returns a new model with a new record that has values from the given result row with optional relationships.
D
- Connection::delete() — Method in class Connection
- Deletes rows from the database.
- MySqlConnection::delete() — Method in class MySqlConnection
- Deletes rows from the database.
- Repository::delete() — Method in class Repository
- Deletes the model from the database.
F
- Connection::formatTable() — Method in class Connection
- Returns an escaped table name aliased to the given alias.
- Connection::formatFields() — Method in class Connection
- Returns a comma separated list of escaped field names from given table aliased with given prefix.
- MySqlConnection::formatFields() — Method in class MySqlConnection
- Returns a comma separated list of escaped field names from given table aliased with given prefix.
- MySqlConnection::formatTable() — Method in class MySqlConnection
- Returns an escaped table name aliased to the given alias.
- Query::fetchResult() — Method in class Query
- Executes the query and returns a PDOStatement instance for the executed query.
- Query::fetchRows() — Method in class Query
- Executes the query and returns all result rows as an associated array.
- Query::fetchModels() — Method in class Query
- Executes the query and returns models for each row with optionally included relationships.
- Query::fetchCallback() — Method in class Query
- Executes the query and returns an array of results that have been passed through the given callback.
- Relationship::fillRelationship() — Method in class Relationship
- Fills this relationship for the given records from the list of given records.
- Relationship::fillSingleRecord() — Method in class Relationship
- Fills this unique relationship for a single record.
- RelationshipFiller::fill() — Method in class RelationshipFiller
- Fills the given relationships for all records of a single type.
- Repository::find() — Method in class Repository
- Returns a list of models from the database based on given conditions.
- Repository::findOne() — Method in class Repository
- Returns a single model based on the given conditions.
- Repository::findByPrimaryKey() — Method in class Repository
- Finds a single model based on the primary key.
- Repository::fillRelationships() — Method in class Repository
- Fills the given relationships for the given models.
- $StaticSchema#fields — Property in class StaticSchema
G
- Connection::getConnection() — Method in class Connection
- Returns the underlying PDO connection to the database.
- MySqlConnection::getConnection() — Method in class MySqlConnection
- Returns the underlying PDO connection to the database.
- ConnectionProvider::getConnection() — Method in class ConnectionProvider
- Provides the active PDO connection and initializes it if necessary.
- GenericConnectionProvider — Class in namespace Simply\Database\Connection\Provider
- A generic lazy loading connector that can take any kind of PDO data source name.
- GenericConnectionProvider::getConnection() — Method in class GenericConnectionProvider
- Provides the active PDO connection and initializes it if necessary.
- MySqlConnectionProvider::getDataSourceName() — Method in class MySqlConnectionProvider
- Returns the data source name based on the hostname and the database.
- MySqlConnectionProvider::getOptions() — Method in class MySqlConnectionProvider
- Returns the default PDO options to use for the connection.
- Model::getDatabaseRecord() — Method in class Model
- Returns the database record for the model.
- Query::generateRows() — Method in class Query
- Returns a generator that fetches the rows one by one for memory efficient processing.
- Query::generateModels() — Method in class Query
- Returns a generator that fetches the models one by one for memory efficient processing.
- Query::generateCallback() — Method in class Query
- Returns a generator that returns the result of the callback called for each result row one by one.
- Record::getPrimaryKey() — Method in class Record
- Returns the primary key for the record as it was at the time the record was loaded.
- Record::getSchema() — Method in class Record
- Returns the schema for the record data.
- Record::getModel() — Method in class Record
- Returns the model associated with the record and initializes it if has not been initialized yet.
- Record::getReferencedRecords() — Method in class Record
- Returns the list of referenced records for the given relationship.
- Record::getRelatedModel() — Method in class Record
- Returns the model of the referenced record in a unique relationship.
- Record::getRelatedModels() — Method in class Record
- Returns list of models referenced by this record via the given relationship.
- Record::getRelatedModelsByProxy() — Method in class Record
- Gets list of models that are referenced by records that this record references.
- Record::getAllReferencedRecords() — Method in class Record
- Returns list of records recursively referenced by this record or any referenced record.
- Record::getDatabaseValues() — Method in class Record
- Returns the values for the fields in this record for storing in database.
- Record::getChangedFields() — Method in class Record
- Returns list of all fields that have been modified since the records state was last updated.
- Relationship::getName() — Method in class Relationship
- Returns the name of the relationship.
- Relationship::getSchema() — Method in class Relationship
- Returns the referring schema.
- Relationship::getFields() — Method in class Relationship
- Returns the referring fields.
- Relationship::getReferencedSchema() — Method in class Relationship
- Returns the referenced schema.
- Relationship::getReferencedFields() — Method in class Relationship
- Returns referenced fields.
- Relationship::getReverseRelationship() — Method in class Relationship
- Returns the reverse relationship.
- Schema::getModel() — Method in class Schema
- Returns the model class used to operate on the records from this schema.
- Schema::getTable() — Method in class Schema
- Returns the name of the table for the schema.
- Schema::getPrimaryKey() — Method in class Schema
- Returns a list fields that define the primary key for the schema.
- Schema::getFields() — Method in class Schema
- Returns the list of fields for the schema.
- Schema::getRelationshipDefinitions() — Method in class Schema
- Returns an associative list of relationship definitions for the schema.
- Schema::getRelationships() — Method in class Schema
- Returns a list of all relationships for the schema.
- Schema::getRelationship() — Method in class Schema
- Returns a single relationship with the given name.
- StaticSchema::getModel() — Method in class StaticSchema
- Returns the model class used to operate on the records from this schema.
- StaticSchema::getTable() — Method in class StaticSchema
- Returns the name of the table for the schema.
- StaticSchema::getPrimaryKey() — Method in class StaticSchema
- Returns a list fields that define the primary key for the schema.
- StaticSchema::getFields() — Method in class StaticSchema
- Returns the list of fields for the schema.
- StaticSchema::getRelationshipDefinitions() — Method in class StaticSchema
- Returns an associative list of relationship definitions for the schema.
H
- Record::hasReferencedRecords() — Method in class Record
- Tells if the referenced records for the given relationship has been loaded.
I
- Connection::insert() — Method in class Connection
- Inserts a row the database with given column values.
- MySqlConnection::insert() — Method in class MySqlConnection
- Inserts a row the database with given column values.
- GenericConnectionProvider::initializeConnection() — Method in class GenericConnectionProvider
- Initializes the PDO connection when first requested.
- InvalidRelationshipException — Class in namespace Simply\Database\Exception
- Exception that gets thrown when trying to use undefined relationships or incorrect types of relationships.
- Record::isEmpty() — Method in class Record
- Tells if the record is empty, i.e. none of the fields have any values.
- Record::isNew() — Method in class Record
- Tells if the record is new and not yet inserted into the database.
- Record::isDeleted() — Method in class Record
- Tells if the record has been deleted from the database.
- Relationship::isUniqueRelationship() — Method in class Relationship
- Tells if the relationship is unique or not.
- Repository::insert() — Method in class Repository
- Inserts the given model to the database.
M
- MySqlConnection — Class in namespace Simply\Database\Connection
- Provides the basic functionality to operate on a MySQL database.
- MySqlConnectionProvider — Class in namespace Simply\Database\Connection\Provider
- Basic connection provider for MySQL databases.
- MissingRecordException — Class in namespace Simply\Database\Exception
- Exception that gets thrown when trying to refresh, update or delete a record that no longer exists in the database.
- Model — Class in namespace Simply\Database
- A class the defines that possible interactions with a database record.
- $StaticSchema#model — Property in class StaticSchema
O
- Record::offsetExists() — Method in class Record
- Tells if the value in the given field is other than null.
- Record::offsetGet() — Method in class Record
- Returns the value for the given field.
- Record::offsetSet() — Method in class Record
- Sets the value for the given field.
- Record::offsetUnset() — Method in class Record
- Sets the value of the given field to null and marks it unchanged, if the record has not yet been inserted.
P
- $StaticSchema#primaryKey — Property in class StaticSchema
Q
- Connection::query() — Method in class Connection
- Executes an arbitrary SQL query in the database.
- MySqlConnection::query() — Method in class MySqlConnection
- Executes an arbitrary SQL query in the database.
- Query — Class in namespace Simply\Database
- Provides convenience for writing custom queries while taking advantage of existing defined schemas.
- Repository::query() — Method in class Repository
- Returns a custom query object for the given SQL statement.
R
- $Model#record — Property in class Model
- Record — Class in namespace Simply\Database
- Represents data loaded from a database.
- Relationship — Class in namespace Simply\Database
- Represents a relationship between two schemas.
- RelationshipFiller — Class in namespace Simply\Database
- Facilitates filling relationships for multiple records at the same time.
- Repository — Class in namespace Simply\Database
- Provides functionality to perform basic database operations on models.
- Repository::refresh() — Method in class Repository
- Updates the field values for the model from the database.
- $StaticSchema#relationships — Property in class StaticSchema
S
- Connection::select() — Method in class Connection
- Selects rows from the database.
- MySqlConnection::select() — Method in class MySqlConnection
- Selects rows from the database.
- Record::setReferencedRecords() — Method in class Record
- Loads the referenced records for the given relationship.
- Record::setDatabaseValues() — Method in class Record
- Sets the values for the fields in the record loaded from the database.
- Repository::save() — Method in class Repository
- Inserts or updates the given model based on its state.
- Schema — Class in namespace Simply\Database
- A schema for a database table.
- StaticSchema — Class in namespace Simply\Database
- Schema implementation that provides the schema definition via static class properties.
T
- $StaticSchema#table — Property in class StaticSchema
U
- Connection::update() — Method in class Connection
- Updates rows in the database.
- MySqlConnection::update() — Method in class MySqlConnection
- Updates rows in the database.
- Record::updateState() — Method in class Record
- Updates the state of the record after the appropriate database operation.
- Repository::update() — Method in class Repository
- Updates the model in the database.
W
- Query::withSchema() — Method in class Query
- Returns a new query object with the given schema.
- Query::withParameters() — Method in class Query
- Returns a new query with the given parameters.
- Query::withoutSchemas() — Method in class Query
- Returns a new query object without any schemas.
- Query::withoutParameters() — Method in class Query
- Returns a new query object without any inserted parameters.
_
- MySqlConnection::__construct() — Method in class MySqlConnection
- MySqlConnection constructor.
- GenericConnectionProvider::__construct() — Method in class GenericConnectionProvider
- GenericConnectionProvider constructor.
- MySqlConnectionProvider::__construct() — Method in class MySqlConnectionProvider
- MySqlConnectionProvider constructor.
- Model::__construct() — Method in class Model
- Model constructor.
- Query::__construct() — Method in class Query
- Query constructor.
- Record::__construct() — Method in class Record
- Record constructor.
- Relationship::__construct() — Method in class Relationship
- Relationship constructor.
- RelationshipFiller::__construct() — Method in class RelationshipFiller
- RelationshipFiller constructor.
- Repository::__construct() — Method in class Repository
- Repository constructor.
- Schema::__construct() — Method in class Schema
- Schema constructor.