Skip to content

Releases: oscarotero/simple-crud

6.11.0

23 Apr 19:23
Compare
Choose a tag to compare
  • Added support to Point fields
  • The magic method SimpleCrud\Row::__get() returns the values as reference

6.10.0

14 Apr 10:24
Compare
Choose a tag to compare
  • The field method Field::setConfig() returns self
  • If a field value is an empty strings and null values are allowed, save null.
  • 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 the Field 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

05 Feb 12:56
Compare
Choose a tag to compare
  • 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

30 Dec 10:03
Compare
Choose a tag to compare

Changed Serializable field:

  • Silent errors
  • Allow to pass options, by default allowed_classes is false (only php7)

6.8.0

06 Nov 16:16
Compare
Choose a tag to compare

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

29 Oct 12:07
Compare
Choose a tag to compare
  • Fixed scheme detection with fields with zerofill
  • Added page modifier to select:
$posts = $db->post
    ->select()
    ->page(1, 50)
    ->run();

$posts->count(); //50
$posts->getPage(); //1
$posts->getPrevPage(); //NULL
$posts->getNextPage(); //2

6.6.2

08 Sep 08:32
Compare
Choose a tag to compare

Fixed variable name

6.6.1

08 Sep 08:17
Compare
Choose a tag to compare

Fixed a bug in which Table::dataFromDatabase() get the raw data from the database instead the normalized values by fields.

6.6.0

01 Sep 16:28
Compare
Choose a tag to compare
  • Added SimpleCrud::onExecute callback #4
  • SimpleCrud::setAttribute can be used to set attributes to the PDO.

6.5.0

31 Aug 16:07
Compare
Choose a tag to compare

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();