forked from cebe/yii2-openapi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCustomSpecAttr.php
More file actions
59 lines (50 loc) · 1.88 KB
/
CustomSpecAttr.php
File metadata and controls
59 lines (50 loc) · 1.88 KB
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
50
51
52
53
54
55
56
57
58
59
<?php
/**
* @copyright Copyright (c) 2018 Carsten Brandt <mail@cebe.cc> and contributors
* @license https://github.com/cebe/yii2-openapi/blob/master/LICENSE
*/
namespace cebe\yii2openapi\lib;
class CustomSpecAttr
{
// --- For component schema ---
//Custom table name
public const TABLE = 'x-table';
//Primary key property name, if it is different from "id" (Only one value, compound keys not supported yet)
public const PRIMARY_KEY = 'x-pk';
//List of table indexes
public const INDEXES = 'x-indexes';
// --- For each property schema ---
//Custom fake data for property
public const FAKER = 'x-faker';
// Custom db type (MUST CONTAINS ONLY DB TYPE! (json, jsonb, uuid, varchar etc))
public const DB_TYPE = 'x-db-type';
/**
* Provide default value by database expression
* @example `current_timestamp()`
* @see https://dev.mysql.com/doc/refman/8.0/en/data-type-defaults.html
* @see https://github.com/cebe/yii2-openapi/blob/master/README.md#x-db-default-expression
*/
public const DB_DEFAULT_EXPRESSION = 'x-db-default-expression';
/**
* Foreign key constraints. See README for usage docs
*/
public const FK_ON_DELETE = 'x-fk-on-delete';
public const FK_ON_UPDATE = 'x-fk-on-update';
/**
* Foreign key column name. See README for usage docs
*/
public const FK_COLUMN_NAME = 'x-fk-column-name';
/**
* Drop table Migrations to be generated from removed component schemas
* See README for docs
*/
public const DELETED_SCHEMAS = 'x-deleted-schemas';
/**
* Foreign key column name. See README for usage docs
*/
public const NO_RELATION = 'x-no-relation';
/**
* Custom route (controller ID/action ID) instead of auto-generated. See README for usage docs. https://github.com/cebe/yii2-openapi/issues/144
*/
public const ROUTE = 'x-route';
}