Skip to content

Commit

Permalink
Update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Moln committed May 24, 2023
1 parent 5e748e3 commit becae01
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 6 deletions.
45 changes: 42 additions & 3 deletions README-zh.md
Expand Up @@ -136,6 +136,45 @@ $app->post(
验证器
--------

- [`DbalRecordExistsFilter`](src/Opis/Filter/DbalRecordExistsFilter.php): 使用 `doctrine/dbal` 验证DB记录是否存在
- [`DoctrineRecordExistsFilter`](src/Opis/Filter/DoctrineRecordExistsFilter.php): 使用 `doctrine/orm` 验证DB记录是否存在
- [`RecordExistsFilter`](src/Opis/Filter/RecordExistsFilter.php): 使用 `PDO` 验证DB记录是否存在
- [`DbalRecordExistsFilter`](src/Opis/Filter/DbalRecordExistsFilter.php): 使用 `doctrine/dbal` 验证DB记录是否存在.
json-schema `$filters`配置:
```json5
{
"$func": "dbal-exists",
"$vars": {
"db": "db", // Get DBAL object by container.
"sql": "select ...", // Set custom SQL
"table": "foo", // Table name
"field": "key", // Field name
"exists": true // Check record exists or not exists.
}
}
```
- [`DoctrineRecordExistsFilter`](src/Opis/Filter/DoctrineRecordExistsFilter.php): 使用 `doctrine/orm` 验证DB记录是否存在。
json-schema `$filters`配置:
```json5
{
"$func": "orm-exists",
"$vars": {
"db": "orm.default", // Get ORM object by container.
"dql": "select ...", // Set custom DQL
"entity": "Foo", // Entity name
"field": "key", // Field name
"exists": true // Check record exists or not exists.
}
}
```
- [`RecordExistsFilter`](src/Opis/Filter/RecordExistsFilter.php): 使用 `PDO` 验证DB记录是否存在。
json-schema `$filters`配置:
```json5
{
"$func": "db-exists",
"$vars": {
"db": "db", // Get DBAL object by container.
"sql": "select ...", // Set custom SQL
"table": "foo", // Table name
"field": "key", // Field name
"exists": true // Check record exists or not exists.
}
}
```
45 changes: 42 additions & 3 deletions README.md
Expand Up @@ -138,6 +138,45 @@ $app->post(
Validators
----------

- [`DbalRecordExistsFilter`](src/Opis/Filter/DbalRecordExistsFilter.php) : Use `doctrine/dbal` to check record exists.
- [`DoctrineRecordExistsFilter`](src/Opis/Filter/DoctrineRecordExistsFilter.php) : Use `doctrine/orm` to check record exists.
- [`RecordExistsFilter`](src/Opis/Filter/RecordExistsFilter.php) : Use `PDO` to check record exists.
- [`DbalRecordExistsFilter`](src/Opis/Filter/DbalRecordExistsFilter.php): Use `doctrine/dbal` to check record exists.
The json-schema `$filters` config:
```json5
{
"$func": "dbal-exists",
"$vars": {
"db": "db", // Get DBAL object by container.
"sql": "select ...", // Set custom SQL
"table": "foo", // Table name
"field": "key", // Field name
"exists": true // Check record exists or not exists.
}
}
```
- [`DoctrineRecordExistsFilter`](src/Opis/Filter/DoctrineRecordExistsFilter.php): Use `doctrine/orm` to check record exists.
The json-schema `$filters` config:
```json5
{
"$func": "orm-exists",
"$vars": {
"db": "orm.default", // Get ORM object by container.
"dql": "select ...", // Set custom DQL
"entity": "Foo", // Entity name
"field": "key", // Field name
"exists": true // Check record exists or not exists.
}
}
```
- [`RecordExistsFilter`](src/Opis/Filter/RecordExistsFilter.php): Use `PDO` to check record exists.
The json-schema `$filters` config:
```json5
{
"$func": "db-exists",
"$vars": {
"db": "db", // Get DBAL object by container.
"sql": "select ...", // Set custom SQL
"table": "foo", // Table name
"field": "key", // Field name
"exists": true // Check record exists or not exists.
}
}
```

0 comments on commit becae01

Please sign in to comment.