Files
EasyAdmin8/app/admin/service/curd/templates/model/model.code
wolfcode 5d58248cf4 feat(curd): add relation data binding and optimize model construction
- Add relation data binding in model construction
- Update model template to include new relation construction logic
- Remove unused index method template
2024-12-20 16:26:56 +08:00

25 lines
420 B
Plaintext

<?php
namespace {{modelNamespace}};
use app\common\model\TimeModel;
class {{modelName}} extends TimeModel
{
protected $name = "{{table}}";
protected $table = "{{prefix_table}}";
protected $deleteTime = {{deleteTime}};
public array $notes = {{selectArrays}};
public function __construct(object|array $data = [])
{
parent::__construct($data);
{{constructRelation}}
}
}