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.
3.0.0 - 2024-10-29
- Official support for PostgreSQL.
- Moved to
DevTheorem
namespace. - Phaster now validates that property values are scalar or null when inserting and updating rows.
- PHP 8.1+ is now required.
- All previously deprecated methods.
2.9.0 - 2024-09-10
processValues()
now allows setting the ID of an existing row on the returned object, in which case a new row will not be inserted, and the specified ID will be returned in the list of row IDs.
2.8.0 - 2023-12-22
countEntities()
method and correspondingcount()
route handler. This allows counting the rows that match a query/filter without selecting them.
2.7.0 - 2023-09-27
writableId
bool property to optionally make the ID column writable.
2.6.0 - 2023-08-01
output
bool parameter onProp
constructor.
col
is now optional when constructingProp
with agetValue
function.
- Error when a
Prop
depends on a property declared in one of theget*Map
methods.
2.5.0 - 2023-03-05
- Minor code cleanup and refactoring.
getDuplicateError()
andgetConstraintError()
methods. These tend to just result in unhelpful error messages which lack important details about why the conflict occurred. A better approach is to add custom checks and errors for conflicts that can occur during normal usage.- Unnecessary
QueryOptions
methods in favor of readonly properties.
2.4.0 - 2022-11-06
getSelectProps()
method as a preferred alternative togetPropMap()
when using PHP 8+.
- Moved most internal methods to a separate class for improved code maintainability.
getPropMap()
method. UsegetSelectProps()
instead.
2.3.0 - 2021-12-15
getBaseSelect()
method to support bound params in base select query.
propertiesToColumns()
now optionally allows conversions with a partial column map. This makes it possible to generate secondary filters using a subset of properties.
2.2.2 - 2021-08-15
- Internal refactoring and static analysis improvements.
2.2.1 - 2021-02-22
- Specified additional types and enabled Psalm static analysis.
- PHP 7.4+ is now required.
2.2.0 Primordial Refinement - 2020-03-22
getOriginalFilter()
method toQueryOptions
for retrieving the unprocessed filter array.
2.1.0 Benevolent Mystique - 2019-08-05
processRow()
method to alter a row directly before it is inserted or updated. Useful for setting columns that aren't in the property map.
- PUT and PATCH requests now return the number of affected rows, and no longer produce an error if no rows were affected (e.g. if the request didn't change the value of any property).
- Excluded additional test files from production bundle.
2.0.0 Pressurized Arrangement - 2019-03-22
$sort
parameter togetEntitiesByIds()
.
- By default, results are now ordered by the ID field.
$fields
is now the second parameter ofgetEntities()
instead of the last.
- Previously deprecated
getBaseSelect()
,getIdColumn()
,getSelectId()
, androwsToJson()
methods.
1.2.2 Pasteurized Recognition - 2019-03-04
getById()
route handler now respectsfields
parameter and only selects the specified properties.
1.2.1 Reliant Progenitor - 2019-02-24
- Support for specifying dependent fields along with
getValue()
function. Dependents of requested fields that weren't explicitly requested, or aren't default, will still be selected but not output.
- Properly check
nullGroup
properties nested multiple levels deep. For example, when selecting the fielda.b.c
, ifa
is a nullable group it will now be checked and set to null as expected. Previously only the direct parent of a selected field was checked.
1.2.0 Emancipation Propagation - 2019-02-22
- Default and maximum limit can now be configured for each search route. If not configured, these are set to 25 and 1000, respectively.
getBaseQuery()
method, which has an$options
parameter that an instance ofQueryOptions
is passed to. This makes it easy to only select specified field columns, and optionally customize the query based on which fields are selected or particular filter/sort values.getPropMap()
method, which allows merging additional property info withgetSelectMap()
. For example, a type or value getter function can be specified to determine how the property is output.- Optional
fields
parameter ongetEntityById()
,getEntitiesByIds()
, andgetEntities()
methods. Takes an array of strings specifying which fields to select. If left empty all default properties will be selected.
getBaseSelect()
- usegetBaseQuery()
instead.rowsToJson()
- mapped property information is now used to automatically output selected fields.getIdColumn()
andgetSelectId()
- set anid
property ingetSelectMap()
orgetPropMap()
instead. If the select query uses a different ID column name than the table used for inserts/updates/deletes, override the table's ID column name by setting anid
property ingetMap()
.
1.1.1 Maximal Limitation - 2019-01-16
- Error when requesting the maximum page size of 1000.
- Upgraded peachy-sql dependency to v6.0.
1.1.0 Ambiguous Identity - 2019-01-11
getSelectId()
method to optionally override the column used to get entities by ID. Necessary when a joined table has a column with the same name as the ID column.- Return
offset
,limit
, andlastPage
properties from search route handler. This makes it easy for API clients to see if there are more results to request.
1.0.2 Optimal Fixture - 2017-05-16
- Methods for retrieving, patching, and deleting entities by IDs now return early if passed an empty IDs array.
1.0.1 Exacting Characteristic - 2017-03-14
RouteHandler
now ensures that search parameters have the correct type.
1.0.0 Cosmic Luminary - 2017-03-09
- Initial stable release