-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTypesModel.php.tpl
49 lines (37 loc) · 2.29 KB
/
TypesModel.php.tpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
declare(strict_types=1);
{{{NAME_SPACE}}}
/**
* @method {{{MODEL_OR_COLLECTION_CLASS_NAME_PREFIX}}}Collection createNewCollection(\GDAO\Model\RecordInterface ...$list_of_records)
* @method {{{RECORD_CLASS_NAME_PREFIX}}}Record createNewRecord(array $col_names_n_vals = [])
* @method ?{{{RECORD_CLASS_NAME_PREFIX}}}Record fetchOneRecord(?object $select_obj=null, array $relations_to_include=[])
* @method ?{{{RECORD_CLASS_NAME_PREFIX}}}Record fetchOneByPkey($id, $relations_to_include = [])
* @method {{{RECORD_CLASS_NAME_PREFIX}}}Record[] fetchRecordsIntoArray(?object $select_obj=null, array $relations_to_include=[])
* @method {{{RECORD_CLASS_NAME_PREFIX}}}Record[] fetchRecordsIntoArrayKeyedOnPkVal(?\Aura\SqlQuery\Common\Select $select_obj=null, array $relations_to_include=[])
* @method {{{MODEL_OR_COLLECTION_CLASS_NAME_PREFIX}}}Collection fetchRecordsIntoCollection(?object $select_obj=null, array $relations_to_include=[])
* @method {{{MODEL_OR_COLLECTION_CLASS_NAME_PREFIX}}}Collection fetchRecordsIntoCollectionKeyedOnPkVal(?\Aura\SqlQuery\Common\Select $select_obj=null, array $relations_to_include=[])
*/
class {{{MODEL_OR_COLLECTION_CLASS_NAME_PREFIX}}}Model extends {{{MODEL_EXTENDED}}} {
protected ?string $collection_class_name = {{{MODEL_OR_COLLECTION_CLASS_NAME_PREFIX}}}Collection::class;
protected ?string $record_class_name = {{{RECORD_CLASS_NAME_PREFIX}}}Record::class;
protected ?string $created_timestamp_column_name = {{{CREATED_TIMESTAMP_COLUMN_NAME}}};
protected ?string $updated_timestamp_column_name = {{{UPDATED_TIMESTAMP_COLUMN_NAME}}};
protected string $primary_col = '{{{PRIMARY_COL_NAME}}}';
protected string $table_name = '{{{TABLE_NAME}}}';
public function __construct(
string $dsn = '',
string $username = '',
string $passwd = '',
array $pdo_driver_opts = [],
string $primary_col_name = '',
string $table_name = ''
) {
{{{INCLUDE_TABLE_COL_METADATA}}}
parent::__construct($dsn, $username, $passwd, $pdo_driver_opts, $primary_col_name, $table_name);
// Define relationships below here
//$this->belongsTo(...)
//$this->hasMany(...);
//$this->hasManyThrough(...);
//$this->hasOne(...)
}
}