Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View cureseven's full-sized avatar
:octocat:
:octocat: :octocat: :octocat: :octocat: :octocat:

cureseven cureseven

:octocat:
:octocat: :octocat: :octocat: :octocat: :octocat:
View GitHub Profile
@cureseven
cureseven / paginate.php
Last active March 7, 2021 04:18
cakephp3.0のpaginateをみた
<?php
public function paginate($object, array $settings = [])
{
// 第1引数がQueryInterfaceを実装したobjectだったら
// RepositoryInterfaceを実装したオブジェクトを呼び出す
if ($object instanceof QueryInterface) {
$query = $object;
$object = $query->repository();
}
getEvent
1. event
2. sheets配列に作ったsheetをappend
3. reservations配列に作ったreservationをappend
4. sheetに予約を当てはめていく
- sheet構造体を作る
- 該当のevent.Sheetsのdetailにsheetを当てはめる
- イベント構造体にイベント情報を格納
- eventのsheetsフィールドはSheets構造体のmapなのん