Releases: oscarotero/simple-crud
Releases · oscarotero/simple-crud
6.11.0
- Added support to
Point
fields - The magic method
SimpleCrud\Row::__get()
returns the values as reference
6.10.0
- The field method
Field::setConfig()
returnsself
- If a field value is an empty strings and
null
values are allowed, savenull
. - Fixed tests in php 7
- Fixed other bugs.
Breaking changes
- Removed
File
field, and moved to a different repository: https://github.com/oscarotero/simple-crud-extra-fields - Added magic properties to
Table
, that returns theField
instances. For example:$simplecrud->post->id
. - Replaced the property
$table->name
by the method$table->getName()
- Removed the property
$table->fields
. Use the magic method to get a specific property or$table->getScheme()['fields']
to get the list of all fields.
6.9.0
- New modifier
join()
for "SELECT" queries, to allow to use any JOIN method (inner, left, right, etc...) - Fixed fields type
int
that were not detected as integers
6.8.1
Changed Serializable field:
- Silent errors
- Allow to pass options, by default
allowed_classes
is false (only php7)
6.8.0
Added a first argument to Row::toArray()
and RowCollection::toArray()
to configure whether the array is generated recursively or not (true by default):
$posts = $db->post->select()->run();
//Default behaviour: the array is recursive:
$array = $posts->toArray();
echo $array[1]['title'];
//Set false to do not generate the array recursively
$array = $posts->toArray(false);
echo $array[1]->title;
6.7.0
- Fixed scheme detection with fields with
zerofill
- Added
page
modifier toselect
:
$posts = $db->post
->select()
->page(1, 50)
->run();
$posts->count(); //50
$posts->getPage(); //1
$posts->getPrevPage(); //NULL
$posts->getNextPage(); //2
6.6.2
Fixed variable name
6.6.1
Fixed a bug in which Table::dataFromDatabase()
get the raw data from the database instead the normalized values by fields.
6.6.0
6.5.0
Allow to define custom methods to Row
and RowCollection
dinamically. For example:
$db->users->setRowMethod('getFullName', function () {
return $this->firstName.' '.$this->lastName;
});
$user = $db->users[1];
echo $user->getFullName();