All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
7.5.0 - 2021-04-24
isset($row->fieldname)
returnstrue
in the following cases:- If
fieldname
is direct related table with a value. For example:isset($comment->post)
returnstrue
ifisset($comment->post_id)
. - If
fieldname
is a related table with many values. For example:isset($post->comment)
always return true even if the post has zero comments.
- If
7.4.2 - 2021-04-01
- The array syntax to update a table row (Like
$db->post[2] = ['title' => 'New title'];
) didn't work in all cases. This fix changed the return type ofTable::offsetSet
tovoid
(previously it wasRow
). #41
7.4.1 - 2020-03-12
- Support for PHP 7.2 #37
7.4.0 - 2020-01-10
SelectAggregate
query allows to set not only fields but anything (math operations, for instance) and save the result as a column #36Select
query has thewhereSprintf
andorWhereSprintf
modifiers.- New method
Table::get
To return a row from a table
- Magic method to return rows from a table using a field. Use
$table->get(['slug' => 'value'])
instead$table->slug('value')
.
7.3.6 - 2019-12-25
- New function
Database::clearCache()
to clear the cache of all tables
7.3.5 - 2019-12-12
- New function
getArray()
to SELECT queries, to return an array with data instead aRow
orRowCollection
.
NULL
values inJson
andSerializable
fields
7.3.4 - 2019-12-03
- Revert the bugfix added in v7.3.0 about not including
NULL
values on insert and fixed in a different way. - Added
void
return types to some methods ofField
class.
7.3.3 - 2019-12-01
- The field
Point
now use the functionST_AsText
insteadasText
(that was deprecated and removed in MySql 8)
7.3.2 - 2019-11-28
- New method
bindValue()
to SELECT queries
7.3.1 - 2019-11-28
- New method
orIgnore()
to INSERT queries, to ignore the insert on duplicate keys
- Ignore duplications on insert many-to-many relations, instead throw an exception
7.3.0 - 2019-11-28
- Queries have the method
get
as an alias ofrun
. - New method
Table::getOrCreate()
. - Magic methods to select a row by other unique keys than id. For example
$db->post->slug('post-slug')
. - New method
whereEquals
to SELECT queries.
- Do not include
NULL
values on insert, in order to generate defaults values in the database (for example for TIMESTAMP)
7.2.5 - 2019-11-11
- Exception thrown on load relations including NULL values
7.2.4 - 2019-11-07
- Row::id() to return the id of the row (and generate one if it's empty)
- Execute Row::relate() when the row is not saved (and does not have an id)
7.2.3 - 2019-11-07
- Allow to assign names to the field
Field
factory
7.2.2 - 2019-11-07
- Allow to override the default constants
Table::ROW_CLASS
andTable::ROWCOLLECTION_CLASS
7.2.1 - 2019-08-31
- FieldFactories are not initialized in the database constructor.
7.2.0 - 2019-08-25
- New method
Row::reload()
refresh the data from the database and, optionally, discard changes. - New argument to
RowCollection::toArray()
to convert only the collection but not the rows. - Provided a basic event dispatcher
- Added the
Table::init()
method to run custom code after instantation.
- Field
Serialize
returnsNULL
if the value is not a string. NULL
values on insert.- Update a row with no changes.
7.1.0 - 2019-08-23
- BREAKING: The way to define custom fields has changed in order to make it more easy and less verbose.
This library was rewritten and a lot of breaking changes were included.
- This changelog
- Minimum requirement is
php >= 7.2
- Added
Atlas.Pdo
as dependency - Use PSR-14 Event Dispatcher to handle events
- Added
Atlas.Query
as a dependency to create the queries and adopt its API - The pagination info is returned with
$selectQuery->getPageInfo()
function. - Many other changes. See the docs.