Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
koriym committed Feb 15, 2021
1 parent 924b815 commit 099da50
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 22 deletions.
23 changes: 3 additions & 20 deletions README.ja.md
Expand Up @@ -136,16 +136,6 @@ INSERT INTO memo (user_id, memo) VALUES (:user_id, :memo);

バリューオブジェクトの引数のデフォルトの値の`null`がSQLで使われることは無い事に注意してください。値が渡されないと、nullの代わりにインジェクトされたバリューオブジェクトのスカラー値が使われます。

## SqlQuery

`DateTimeIntetface`オブジェクトを渡すと、日付フォーマットされた文字列に変換されてクエリーが行われます。

```php
$sqlQuery->exec('memo_add', ['memo' => 'run', 'created_at' => new DateTime()]);
```

オブジェクトが渡されるとParameter Injectionと同様`toScalar()`または`__toString()`の値に変換されます。

## ページネーション

`#[Pager]`アノテーションで、SELECTクエリーをページングする事ができます。
Expand Down Expand Up @@ -196,12 +186,6 @@ class TodoItem implements TodoItemInterface
}
```

`DateTimeIntetface`オブジェクトを渡すと、日付フォーマットされた文字列に変換されてクエリーが行われます。

```php
$sqlQuery->exec('memo_add', ['created_at' => new DateTime()]);
```

## Get* メソッド

SELECT結果を取得するためには取得する結果に応じた`get*`を使います。
Expand All @@ -217,15 +201,14 @@ Ray.MediaQueryは[Ray.AuraSqlModule](https://github.com/ray-di/Ray.AuraSqlModule
さらに低レイヤーの操作が必要な時はAura.Sqlの[Query Builder](https://github.com/ray-di/Ray.AuraSqlModule#query-builder) やPDOを拡張した[Aura.Sql](https://github.com/auraphp/Aura.Sql) のExtended PDOをお使いください。
[doctrine/dbal](https://github.com/ray-di/Ray.DbalModule) も利用できます。

## バリューオブジェクト

`DateTimeIntetface`オブジェクトを渡すと、日付フォーマットされた文字列に変換されてクエリーが行われます
Parameter Injectionと同様、`DateTimeIntetface`オブジェクトを渡すと日付フォーマットされた文字列に変換されます

```php
$sqlQuery->exec('memo_add', ['memo' => 'run', 'created_at' => new DateTime()]);
```

オブジェクトが渡されるとParameter Injectionと同様`toScalar()`または`__toString()`の値に変換されます。
他のオブジェクトが渡されると`toScalar()`または`__toString()`の値に変換されます。

# Web API

Expand All @@ -239,7 +222,7 @@ interface GetPostInterface
}
```

認証のためのヘッダーの指定などはGuzzleのClinetInterfaceをバインドして行います
認証のためのヘッダーの指定などはGuzzleの`ClinetInterface`をバインドして行います

```php
$this->bind(ClientInterface::class)->toProvider(YourGuzzleClientProvicer::class);
Expand Down
2 changes: 0 additions & 2 deletions README.md
Expand Up @@ -129,8 +129,6 @@ INSERT INTO task (title, created_at) VALUES (:title, :createdAt); // 2021-2-14 0
If no value is passed, the bound current time will be injected.
This eliminates the need to hard-code `NOW()` inside SQL and pass the current time every time.

### Test Time

When testing, you can also set the `DateTimeInterface` binding to a single time, as follows.

```php
Expand Down

0 comments on commit 099da50

Please sign in to comment.