First model
Our first model
- Open your www-project folder.

- in
App/Model folder, create a new .php file and edit it in your favourite code editor.

- Paste the following code, save:
| <?php
namespace App\Model;
use System\DateProperty;
use System\ModelMeta;
use System\StringProperty;
use System\TextProperty;
class MyFirstModel extends \System\Model\DefaultModel
{
public static function meta(): ?ModelMeta
{
return (new ModelMeta('MyFirstModel'))->enable();
}
protected function getAdditionalProperties(): array
{
return [
new StringProperty("name"),
new TextProperty("description"),
new DateProperty("date")
];
}
}
|
- Reload
index.php:

Congratulations
You've successfully modeled your first business entity!
OnError
Next