-
Notifications
You must be signed in to change notification settings - Fork 2
API
Binds a value and returns the bound key
$database->bind(*string|array|number|null $value);
-
*string|array|number|null $value- What to bind
Returns string
$database->bind('foo');
Returns collection
$database->collection(array $data);
-
array $data- Initial collection data
Returns Eden\Sql\Collection
$database->collection();
Returns the delete query builder
$database->delete(*string|null $table);
-
*string|null $table- The table name
Returns Eden\Sql\Delete
$database->delete('foo');
Removes rows that match a filter
$database->deleteRows(*string|null $table, array|string $filters);
-
*string|null $table- The table name -
array|string $filters- Filters to test against
Returns Eden\Sql\Collection
$database->deleteRows('foo');
Returns all the bound values of this query
$database->getBinds();
Returns array
Returns the connection object if no connection has been made it will attempt to make it
$database->getConnection();
Returns resource - PDO connection resource
Returns the last inserted id
$database->getLastInsertedId(string|null $column);
-
string|null $column- A particular column name
Returns int - the id
$database->getLastInsertedId();
Returns a model given the column name and the value
$database->getModel(*string $table, *string $name, *scalar|null $value);
-
*string $table- Table name -
*string $name- Column name -
*scalar|null $value- Column value
Returns Eden\Sql\Model|null
$database->getModel('foo', 'foo', $value);
Returns the history of queries made still in memory
$database->getQueries(int|string|null $index);
-
int|string|null $index- A particular index to return
Returns array|null - the queries
$database->getQueries();
Returns a 1 row result given the column name and the value
$database->getRow(*string $table, *string $name, *scalar|null $value);
-
*string $table- Table name -
*string $name- Column name -
*scalar|null $value- Column value
Returns array|null
$database->getRow('foo', 'foo', $value);
Returns the insert query builder
$database->insert(string|null $table);
-
string|null $table- Name of table
Returns Eden\Sql\Insert
$database->insert();
Inserts data into a table and returns the ID
$database->insertRow(*string $table, *array $setting, bool|array $bind);
-
*string $table- Table name -
*array $setting- Key/value array matching table columns -
bool|array $bind- Whether to compute with binded variables
Returns Eden\Sql\Index
$database->insertRow('foo', array('foo' => 'bar'));
Inserts multiple rows into a table
$database->insertRows(*string $table, array $setting, bool|array $bind);
-
*string $table- Table name -
array $setting- Key/value 2D array matching table columns -
bool|array $bind- Whether to compute with binded variables
Returns Eden\Sql\Index
$database->insertRows('foo');
Returns model
$database->model(array $data);
-
array $data- The initial data to set
Returns Eden\Sql\Model
$database->model();
Queries the database
$database->query(*string $query, array $binds);
-
*string $query- The query to ran -
array $binds- List of binded values
Returns array
$database->query('foo');
Returns search
$database->search(string|null $table);
-
string|null $table- Table name
Returns Eden\Sql\Search
$database->search();
Returns the select query builder
$database->select(string|array $select);
-
string|array $select- Column list
Returns Eden\Sql\Select
$database->select();
Sets all the bound values of this query
$database->setBinds(*array $binds);
-
*array $binds- key/values to bind
Returns Eden\Sql\Index
$database->setBinds(array('foo' => 'bar'));
Sets default collection
$database->setCollection(*string $collection);
-
*string $collection- Collection class name
Returns Eden\Sql\Index
$database->setCollection('foo');
Sets the default model
$database->setModel(*string Model);
-
*string Model- class name
Returns Eden\Sql\Index
$database->setModel('foo');
Sets only 1 row given the column name and the value
$database->setRow(*string $table, *string $name, *scalar|null $value, *array $setting);
-
*string $table- Table name -
*string $name- Column name -
*scalar|null $value- Column value -
*array $setting- Key/value array matching table columns
Returns Eden\Sql\Index
$database->setRow('foo', 'foo', $value, array('foo' => 'bar'));
Returns the update query builder
$database->update(string|null $table);
-
string|null $table- Name of table
Returns Eden\Sql\Update
$database->update();
Updates rows that match a filter given the update settings
$database->updateRows(*string $table, *array $setting, array|string $filters, bool|array $bind);
-
*string $table- Table name -
*array $setting- Key/value array matching table columns -
array|string $filters- Filters to test against -
bool|array $bind- Whether to compute with binded variables
Returns Eden\Sql\Index
$database->updateRows('foo', array('foo' => 'bar'));