Skip to content

2.4.0

Compare
Choose a tag to compare
@github-actions github-actions released this 16 Apr 11:05
· 409 commits to develop since this release

This release brings a lot of focus code-sense and hinting. If you are using modern PHP IDE, you will feel benefit of autocompletion almost everywhere.

Magical hintable fields

The hintable support is another major game changer in sense of cleaness and maintainability. Annotate model fields and used them magically as a real properties.

Usage
add Model class phpdoc:

/**
 * @property string   $name   @Atk4\Field()
 * @property int      $age    @Atk4\Field()
 * @property Standard $mother @Atk4\RefOne()
 */
class X extends Model
{ ...

Use the properties either as standard value property:

$model->age // instead of  $model->get('age')
$model->age = 25 // instead of $model->set('age', 25)

You will also notice that adding fields in examples is using a different syntax:

$this->addField($this->fieldName()->age); // instead of addField('age');

What’s Changed

Breaking Changes

Major Features

  • Convert hardcoded strings in demos to hintable fields (#1559) @mvorisek