NCMB PHP SDKでサーバサイドからmBaaSを使おう /ncmb-php-sdk-details

NCMB PHP SDKでサーバサイドからmBaaSを使おう /ncmb-php-sdk-details

2018-08-24 に開催された「NCMB PHP SDKでサーバサイドからmBaaSを使おう」セミナーの発表資料です。

83f9862ef4599c97e99d020eb8e20d87?s=128

KOYAMA Tetsuji

August 25, 2017
Tweet

Transcript

  1. /$.#1)14%,Ͱ αʔόαΠυ͔ΒN#BB4 Λ࢖͓͏ খࢁ఩ࢤLPZIPHF /$.#ΤόϯδΣϦετ /$.#1)14%,ηϛφʔ

  2. ࣗݾ঺հ খࢁ఩ࢤ ͜΍·ͯͭ͡  ϑϦʔϥϯεΤϯδχΞ ೥݄ΑΓ/$.#ΤόϯδΣϦετ ϢʔβίϛϡχςΟͷதͷਓ ೔ຊ6/*9Ϣʔβձ ೔ຊ1PTUHSF42-Ϣʔβձ ೔ຊ1)1Ϣʔβձ

    !LPZIPHF LPZIPHF
  3. 1)14%,ͷུ֓

  4. w N#BB4͸ຊདྷαʔόӡ༻Λෆཁʹ͢Δ΋ͷ w ͔͠͠αʔϏεػೳ͕૿͑ͯ͘ΔͱɺͦΕ͚ͩͰ ͸ऩ·Βͳ͘ͳΔ w ରཱͰ͸ͳ͘ิ׬͢Δؔ܎ N#BB4Ͱαʔό

  5. w ϞόΠϧΞϓϦͱͷ࿈ܞ w όονॻ͖ͨ͘ͳΒͳ͍  w Ϣʔβʹϓογϡ௨஌ૹΓͨ͘ͳ͍  w ࣗಈεέʔϧ͢Δ,74ͱͯ͠

    αʔό͔Β࢖ͬͯخ͍͠ͱ͜Ζ
  6. w αʔόଆ͔Β࢖͑Δͷ͸ɺݱঢ়Ͱ͸/PEFKT൛͠ ͔ͳ͍ w +BWB൛͸"OESPJEʹಛԽ͍ͯͯ͠αʔόଆͰ͸ ࢖͑ͳ͍ w 1)1൛ͷཁ๬͸ͪΒ΄Β͋ͬͨ ެࣜ4%,ͷݶք

  7. w 1)1͸ଟ͘ͷ΢ΣϒͰ࢖ΘΕ͍ͯΔ w Ϣʔβ૚͕޿͍ w ͱ͕͍ͬͯΔձࣾ͸/PEFΛ࢖͑͹͍͍ w ΤίγεςϜ͕ීٴ͍ͯ͠Δ w ࣗ෼͕1)1Λ޷͖͔ͩΒ

    ͳͥ1)1͔
  8. w QBSTFDPN w 'BDFCPPLʹങऩ͞ΕͨN#BB4αʔϏεͷ࿝ ฮ w ೥݄ʹαʔϏεऴྃ w 1)14%,Λ"4*4ϥΠηϯεͰެ։ 1BSTF1)14%,

  9. w 1BSTFͱ/$.#͸3&45"1*΋Α͘ࣅ͍ͯΔ w 1BSTF4%,͸େมྑ͘Ͱ͖͍ͯͨ w 4%,ͷઃܭͰେมࢀߟʹ͍͍ͤͯͨͩͨ͞ 1BSTF1)14%,

  10. 1)14%,ͷ࢖͍ํ ॳڃฤ

  11. w ॳظԽ w Ϣʔβ؅ཧ w σʔλετΞ w ϑΝΠϧετΞ w ϓογϡ௨஌

    w εΫϦϓτ 1)14%,ͷ࢖͍ํॳڃฤ
  12. Πϯετʔϧ $ composer install "require": { "ncmbmania/php-ncmb": "*" }, w

    $PNQPTFSΛ࢖ͬͯΠϯετʔϧ͠·͢
  13. ॳظԽ use Ncmb\NCMB; $appKey = 'xxxxxxxxxxxxxxx'; $clientKey = 'yyyyyyyyyyyyyyyy'; NCMB::initialize($appKey,

    $clientKey); w ͭͷΩʔΛ༻͍ͯॳظԽ w Ҏ߱ͷαϯϓϧίʔυ͸ॳظԽ͞Ε͍ͯΔ͜ͱ͕લఏ w ໊લۭؒ͸/DNC
  14. Ϣʔβ؅ཧɿαΠϯΞοϓ use Ncmb\User; $user = new User; $user->userName = 'Ncmb_User';

    $user->password = 'si20xG!Ajb5%yu'; $user->signUp(); w Ϣʔβ໊ͱύεϫʔυΛ༻͍ͯ৽نొ࿥
  15. Ϣʔβ؅ཧɿαΠϯΞοϓ use Ncmb\User; $address = 'ncmb@example.jp'; User::sendRegistrationMail($address); w ϝʔϧΞυϨεѼʹձһొ࿥ཁٻΛૹ৴ sendRegistrationMail

  16. Ϣʔβ؅ཧɿϩάΠϯ use Ncmb\User; $userName = 'Ncmb_User'; $password = 'si20xG!Ajb5%yu'; $user

    = User::login($userName, $password); w Ϣʔβ໊ͱύεϫʔυΛ༻͍ͯϩάΠϯ
  17. Ϣʔβ؅ཧɿϩάΞ΢τ use Ncmb\User; User::logout(); w ϩάΞ΢τ͢Δ͚ͩ

  18. Ϣʔβ؅ཧɿϩάΠϯதϢʔβ use Ncmb\User; $user = User::getCurrentUser(); w ݱࡏϩάΠϯ͍ͯ͠ΔϢʔβΛऔಘ

  19. Ϣʔβ؅ཧɿϢʔβͷ࡟আ use Ncmb\User; $userId = 'NmsV9iGunSl6o8Fg'; User::unregister($userId); w ݱࡏϩάΠϯ͍ͯ͠ΔϢʔβΛऔಘ w

    ౉͢ͷ͸ϢʔβͷPCKFDU*E w /$.#ଆͰࣗಈͰൃߦ͞ΕΔ
  20. Ϣʔβ؅ཧɿϢʔβʹ෇Ճ৘ใΛ௥Ճ w 6TFSΫϥε͸0CKFDUΛܧঝ͍ͯ͠ΔͷͰɺ෇Ճ ৘ใΛ௥ՃͰ͖Δ use Ncmb\User; $userName = 'Ncmb_User'; $password

    = 'si20xG!Ajb5%yu'; $user = User::login($userName, $password); $user->age = 30; $user->rank = 27; $user->save();
  21. σʔλετΞ w a/DNCa0CKFDUΫϥεΛ༻͍Δ w a/DNCa6TFSΛ࢝Ίଟ͘ͷΫϥεͷ਌Ϋϥεʹ ͳ͍ͬͯΔɻ

  22. σʔλετΞɿอଘ w ΦϒδΣΫτͷϓϩύςΟʹ஋Ληοτͯ͠ɺ TBWF ϝιουΛݺͿ use Ncmb\Object; $className = 'example';

    $obj = new Object($className); $obj->intKey = 1; $obj->floatKey = 1.0; $obj->stringKey = 'String'; $obj->dateKey = new DateTime(); $obj->save();
  23. σʔλετΞɿอଘ w Ң౓ܦ౓ w TFU ϝιου use Ncmb\Object; use Ncmb\GeoPoint;

    $className = 'example'; $obj = new Object($className); $geoPoint = new GeoPoint(35.1, 139.2); $obj->set('geoKey', $geoPoint); $obj->save();
  24. σʔλετΞɿอଘ w ഑ྻʹ͸TFU"SSBZ ϝιουΛ༻͍Δ use Ncmb\Object; $className = 'example'; $obj

    = new Object($className); $obj->setArray('arrayKey', [1, 2, 3]); $obj->save();
  25. σʔλετΞɿJEΛࢦఆͨ͠ಡࠐ w PCKFDU*E͕͢Ͱʹ෼͔͍ͬͯΔ৔߹ w a/DNCa0CKFDUίϯετϥΫλʹPCKFDU*EΛ౉͢ w GFUDI ϝιουͰಡࠐΈ use Ncmb\Object;

    $className = 'example'; $objectId = '3Dw7EnByRYvtZ3rh'; $obj = new Object($className, $objectId); $obj->fetch();
  26. σʔλετΞɿಛఆͷ৚݅Ͱಡࠐ w PCKFDU*E͕෼͔͍ͬͯͳ͍৔߹΍ಛఆ৚݅ͷݕࡧ ʹ͸ɺa/DNCa2VFSZΫϥεΛ࢖͏ use Ncmb\Query; $className = 'example'; $query

    = new Query($className); $query->equalTo('intKey', 1); $objs = $query->find();
  27. σʔλετΞɿσʔλͷߋ৽ w ಡΈࠐΜͩ0CKFDUʹରͯ͠ɺσʔλΛ௥Ճมߋ ͠TBWF ͢Δ͚ͩɻ use Ncmb\Object; $className = 'example';

    $objectId = '3Dw7EnByRYvtZ3rh'; $obj = new Object($className, $objectId); $obj->fetch(); $obj->appendKey = 'sample'; $obj->save();
  28. ϑΝΠϧετΞ w ςΩετɺը૾ɺԻ੠ͳͲ༷ʑͳσʔλΛ֨ೲͰ ͖ΔετϨʔδ w /DNCa'JMFΫϥεΛ༻͍Δ

  29. ϑΝΠϧετΞอଘ w อଘ͢Δσʔλͷ಺༰ɺ/$.#্ͷϑΝΠϧ໊ Λࢦఆͯ͠ɺ'JMFDSFBUF'SPN%BUB ϝιου ΛݺͿ use Ncmb\File; $data =

    'sample file data'; $fileName = 'sample.txt'; $file = File::createFromData($data, $fileName); $file->save();
  30. ϑΝΠϧετΞಡࠐΈ w ϑΝΠϧ໊Λࢦఆͯ͠ɺ'JMFDSFBUF'SPN4FSWFS ͰpMFΦϒδΣΫτΛ࡞Δ w HFU%BUB ϝιουͰσʔλΛऔಘ use Ncmb\File; $fileName

    = 'sample.txt'; $file = File::createFromServer($fileName); $data = $file->getData();
  31. ϑΝΠϧετΞݕࡧ w 'JMFHFU2VFSZ ͰϑΝΠϧετΞ༻ͷ2VFSZΦ ϒδΣΫτΛऔಘ w ͋ͱ͸ࣗ༝ʹ৚݅Λࢦఆ use Ncmb\File; $query

    = File::getQuery(); $file = $query ->equalTo('fileName', 'sample.txt') ->first(); $data = $file->getData();
  32. ϓογϡ௨஌ૹ৴ w ඞཁͳύϥϝʔλΛઃఆͯ͠ a/DNCa1VTITFOE ΛݺͿ͚ͩ use Ncmb\Push; $options = [

    'immediateDeliveryFlag' => true, 'title' => 'NCMB push', 'message' => 'sample message', 'target' => ['android'], ]; $pushId = Push::send($options);
  33. ϓογϡ௨஌Φϓγϣϯ w ࢦఆͰ͖ΔΦϓγϣϯ͸େมଟ͍ w ʮ3&45"1*ϦϑΝϨϯεϓογϡ௨஌ొ࿥ʯ Λࢀরͷ͜ͱ • http://mb.cloud.nifty.com/doc/current/ rest/push/pushRegistration.html

  34. ϓογϡ௨஌ݕࡧ w 1VTIHFU2VFSZ ϝιουͰ2VFSZΦϒδΣ ΫτΛऔಘ use Ncmb\Push; $query = Push::getQuery();

    $query->equalTo('status', Push::STAT_ERROR); $pushes = $query->find();
  35. ϓογϡ௨஌࡟আ w 1VTIEFMFUF ʹPCKFDU*EΛ౉͢ w ҎԼ͸ਖ਼ৗऴྃͨ͠ϓογϡ௨஌Λશͯ࡟আ͢Δྫ use Ncmb\Push; $query =

    Push::getQuery(); $query->equalTo('status', Push::STAT_SEND_OK); $pushes = $query->find(); foeach ($pushes as $push) { Push::delete($push->getObjectId()); }
  36. εΫϦϓτ࣮ߦ w "1*͔Βୟ͚Δͷ͸࣮ߦػೳͷΈ w a/DNCa4DSJQUFYFDVUF Λ༻͍Δ use Ncmb\Script; $script =

    'sample.js'; $params = [ 'query' => ['name' => 'NCMB Tarou'], ]; $result = Script::execute($script, $params);
  37. εΫϦϓτ(&5Ҏ֎ͷϝιου w a/DNCa4DSJQUFYFDVUF ͷୈҾ਺ use Ncmb\Script; $script = 'sample.js'; $params

    = [ 'query' => ['name' => 'NCMB Tarou'], ]; $method = 'PUT'; $result = Script::execute($script, $params $method);
  38. 1)14%,ͷ࢖͍ํ ্ڃฤ

  39. w "$- w ϩʔϧ w ϦϨʔγϣϯ w ϙΠϯλʔ w 2VFSZ

    w ಛघΦϖϥϯυ w ಈ࡞ઃఆͷ্ॻ͖ 1)14%,ͷ࢖͍ํ্ڃฤ
  40. "$- w "DDFTT$POUSPMM-JTU w /DNCa"DMΛ༻͍Δ use Ncmb\Acl; $acl = new

    Acl; $acl ->setPublicReadAccess(true) ->setPublicWriteAccess(true);
  41. "$-ηοτ w a/DNCa0CKFDUTFU"DM Λ༻͍Δ use Ncmb\Object; $obj = new Object('example');

    $obj->key1 = 'val1'; $obj->setAcl($acl); $obj->save();
  42. "$-ࢦఆํ๏ w a/DNCa"DMͷϝιου setReadAccess: ಛఆϢʔβͷಡࠐݖݶηοτ getReadAccess: ಛఆϢʔβͷಡࠐݖݶήοτ setWriteAccess: ಛఆϢʔβͷॻࠐݖݶηοτ getWriteAccess:

    ಛఆϢʔβͷॻࠐݖݶήοτ {set,get}Public{Read,Write}Access: Ұൠʹର͢Δݖݶ getRole{Read,Write}Access: setRole{Read,Wreite}AccessWithName: ϩʔϧʹର͢Δݖݶ
  43. "$-ࢦఆྫ w શһ͕ಡΊΔ w VTFSͱVTFS͚ͩॻ͚Δ use Ncmb\Acl; $acl = new

    Acl; $acl ->setPublicReadAccess(true) ->setWriteAccess($user1, true) ->setWriteAccess($user2, true);
  44. ϩʔϧ w "$-ʹର͢ΔϢʔβͷηοτ use Ncmb\Role; $roleName = 'myRole'; $role =

    Role::createRole($roleName); $role->getUsers()->add($user1); $role->getUsers()->add($user2); $role->save(); $acl = new Acl; $acl->setRoleWriteAccessWithName($roleName, true);
  45. ϩʔϧೖΕࢠ w ϩʔϧʹϩʔϧΛ௥Ճ use Ncmb\Role; $role1 = Role::createRole('childRole'); $role1->getUsers()->add($user1); $role1->getUsers()->add($user2);

    $role1->save(); $role2 = Role::createRole('parentRole'); $role2->getRoles()->add($role1); $role2->save();
  46. ϙΠϯλ w ΦϒδΣΫτʹผΦϒδΣΫτͷࢀরΛ௥Ճ use Ncmb\Object; $className = 'example'; $obj1 =

    new Object($className, 'Tf1DG2Bvlf4mXn0a'); $obj1->fetch(); $obj2 = new Object($className); $obj2->pointerKey = $obj1; $obj2->save();
  47. ϦϨʔγϣϯ w ϙΠϯλͱಉ༷ʹผΦϒδΣΫτͷࢀরΛ௥Ճ w ಉҰΫϥεʹݶΒΕΔ͕ɺෳ਺ͷΦϒδΣΫτΛઃ ఆͰ͖Δ use Ncmb\Object; // $obj,$obj2

    ͸ಡࠐࡁΈͱ͢Δ $obj = new Object('example'); $relation = $obj->getRelation('relKey', 'example'); $relation->add($obj1); $relation->add($obj2); $obj->save();
  48. 2VFSZ w ݕࡧͷͨΊͷ൚༻Ϋϥε w ߜΓࠐΈ༻ͷϝιουΛඋ͑Δ

  49. 2VFSZ࢖༻๏ w 0CKFDUͷݕࡧ͸2VFSZΛΫϥε໊Λ౉ͯ͠OFX w ͦΕҎ֎͸֤ΫϥεͷHFU2VFSZ ϝιου use Ncmb\Query; $className =

    'example'; $query = new Query($className); $query->equalTo('intKey', 1); $objs = $query->find(); $query = Push::getQuery();
  50. 2VFSZͷ৚݅ઃఆ w a/DNCa2VFSZΛ༻͍༷ͯʑͳ৚݅ͰݕࡧͰ͖Δ equalTo: ஋͕౳͍͠ notEqualTo: ஋͕౳͘͠ͳ͍ lessThan: ࢦఆͨ͠஋ΑΓখ͍͞($lt) lessThanOrEqual:

    ࢦఆͨ͠஋ҎԼ ($lte) greaterThan: ࢦఆͨ͠஋ΑΓେ͖͍ ($gt) greaterThanOrEqual: ࢦఆͨ͠஋Ҏ্ ($gte) containedIn: ஋ؚ͕·ΕΔ ($in) notContainedIn: ஋ؚ͕·Εͳ͍ ($nin)
  51. 2VFSZͷ৚݅ઃఆ ଓ͖ exists: ஋͕ଘࡏ͢Δ ($exists) doesNotExists: ஋͕ଘࡏ͠ͳ͍ regex: ਖ਼نදݱʹϚον ($regex)

    inArray: ഑ྻʹؚ·ΕΔ ($inArray) notInArray: ഑ྻʹؚ·Εͳ͍ ($ninArray) containsAll: ͢΂ͯͷ஋ؚ͕·ΕΔ ($all) matchesQuery: αϒΫΤϦʹ߹க͢ΔσʔλΛϙΠϯ λͱ͍ͯ࣋ͬͯ͠Δ ($inQuery) relatedTo: ΦϒδΣΫτID͕ࢦఆ͞Εͨ਌ͷϦϨʔγϣϯʹඥͮ͘ࢠ
  52. 2VFSZpOEͱpSTU w pOE ͢΂ͯฦ͢ w pSTU ࠷ॳͷͭͷΈ use Ncmb\Query; $className

    = 'example'; $query = new Query($className); $query->equalTo('category', 5); $obj = $query->first(); echo $obj->name;
  53. ಛघΦϖϥϯυ w 3&45"1*Ͱʮ@@PQʯͰࢦఆ͞ΕΔ w ΠϯΫϦϝϯτɺ഑ྻ΁ͷ௥Ճ࡟আͳͲ

  54. ΦϖϥϯυΠϯΫϦϝϯτ use Ncmb\Object; $obj = new Object('example', 'xxxxxxxx'); $obj->fetch(); $obj->increment('intKey',

    2); $obj->save(); w ݱࡏ஋ʹࢦఆͨ͠஋Λ௥Ճ
  55. Φϖϥϯυ"EE use Ncmb\Object; $obj = new Object('example'); $obj->setArray('arrKey', [1, 2,

    3]); $obj->save(); $obj->add('arrKey', [10, 11]); $obj->save(); w ഑ྻʹ஋Λ௥Ճ
  56. Φϖϥϯυ"EE6OJRVF use Ncmb\Object; $obj = new Object('example'); $obj->setArray('arrKey', [1, 2,

    3]); $obj->save(); $obj->addUnique('arrKey', [2, 3, 4]); $obj->save(); w ഑ྻʹ஋Λ௥Ճ ॏෳ͸௥Ճ͠ͳ͍
  57. Φϖϥϯυ3FNPWF use Ncmb\Object; $obj = new Object('example'); $obj->setArray('arrKey', [1, 2,

    3]); $obj->save(); $obj->remove('arrKey', [2, 3]); $obj->save(); w ഑ྻ͔Β஋Λ࡟আ
  58. ಈ࡞ઃఆͷ্ॻ͖ w ඪ४ͷઃఆ஋Λม͍͑ͨ͜ͱ͸··͋Δ w αʔϏεͷΤϯυϙΠϯτ͕มΘΔ w ϩʔΧϧʹϑΣΠΫ"1*αʔόΛཱͯΔ w /$.#JOJUJBMJ[F ͷΦϓγϣϯύϥϝʔλͰ্

    ॻ͖
  59. ಈ࡞ઃఆͷ্ॻ͖ྫ w ϩʔΧϧͷϙʔτʹϑΣΠΫαʔόΛཱͯͨྫ use Ncmb\NCMB; $appKey = 'xxxxxxxxxxxxxxx'; $clientKey =

    'yyyyyyyyyyyyyyyy'; $config = [ 'apiHost' => 'localhost', 'scriptApiHost' => 'localhost', 'port' => 10080, 'protocol' => 'http', ]; NCMB::initialize($appKey, $clientKey, $config);
  60. ૝ఆྫ ϓογϡ௨஌ͷ৔߹

  61. Ұׅ഑৴ͱݸผ഑৴ w શମʹ޲͚ͯͷࠂ஌ͱϢʔβݸਓ΁ͷ௨஌ w DIBOOFMΛར༻͢Δ w εϚϗΞϓϦଆͷ഑৴୺຤ొ࿥࣌ʹଐੑΛ௥Ճ͠ ͓ͯ͘ w Ϣʔβ*%

    ϩάΠϯ͢ΔͳΒ  w ೥ྸɺੑผɺډॅ஍ɺ޷Έ
  62. ͲͪΒͰߜΓࠐΈ w ഑৴୺຤৘ใ *OTUBMMBUJPO ʹ֤छଐੑΛ௥Ճ w 1VTITFOE ͷTFBSDI$POEJUJPOͰࢦఆ w ഑৴୺຤৘ใʹ͸Ϣʔβ*%ͷΈ௥Ճ

    w 6TFSͰߜΓࠐΜͩ*EΛTFBSDI$POEJUJPOʹࢦ ఆ
  63. ߜΓࠐΈ഑৴ w ഑৴୺຤ొ࿥࣌ʹɺډॅ஍ͱ೥୅͕ηοτ͞Ε͍ͯΔͱ͢Δ use Ncmb\Push; $options = [ 'target' =>

    ['android', 'ios'], 'searchCondition' => [ 'place' => 'Kanagawa', 'age' => '30s', ], : ]; $pushId = Push::send($options);
  64. ݸผ഑৴ w ഑৴୺຤ొ࿥࣌ʹɺVTFS*E͕ొ࿥͞Ε͍ͯΔͱ͢Δ use Ncmb\Push; $options = [ 'target' =>

    ['android', 'ios'], 'searchCondition' => [ 'userId' => 'xxxxxxxxx', ], : ]; $pushId = Push::send($options);
  65. 1)14%, ಺෦ղઆ

  66. 1BSTF4%,͔Βม͑ͨͱ͜Ζ w ໊લۭؒ w 1BSTFa1BSTF0CKFDU
 /DNCa0CKFDU w 1BSTFa*OUFSOBMa4FU0QFSBUJPO
 /DNCa0QFSBUJPOa4FU w

    )551ϥΠϒϥϦ w 1BSTF͸DVSMؔ਺
 /$.#͸(V[[MF)UUQa$MJFOU w ͦͷଞ΋͍Ζ͍Ζ
  67. "QJ$MJFOUΫϥε w /DNC"QJ$MJFOUQIQ w 3&45"1*ϦΫΤετૹड৴ͷຊମ w "QJ$MJFOUSFRVFTU ͕ૹड৴ͷ࣮ମ w "QJ$MJFOUTJHO

    Ͱγάωνϟੜ੒ w TFTTJPO5PLFOΛอ࣋͢ΔͨΊͷTUPSBHF΋࣋ͬ ͍ͯΔ
  68. 4UPSBHF*OUFSGBDF w TFTTJPO5PLFOΛอ࣋͢ΔͨΊͷετϨʔδ*' w ࣮૷ͱͯ͠ҎԼͷͭ w /DNCa4UPSBHFa4FTTJPO1)1ηογϣϯ w /DNCa4UPSBHFa.FNPSZϝϞϦ ഑ྻ

     w 1)1ηογϣϯ͕༗ޮͳ؀ڥͰ͸4FTTJPO͕બ͹ ΕΔ
  69. &ODPEFS w 1)1ͷม਺Λ/$.#3&45"1*ͷσʔλදݱʹม׵ ͢Δ w &ODPEBCMF*OUBSGBDFΛ࣮૷͍ͯͨ͠ΒFODPEF ϝ ιουΛݺͼग़͢ use Ncmb\Encoder;

    $encoded = Encoder::encode(new DateTime()); var_dump($encoded); // array(2) { // ["__type"]=> // string(4) "Date" // ["iso"]=> // string(24) "2017-08-24T09:01:39.000Z" // }
  70. /DNCa0QFSBUJPOa w ΦϖϥϯυͷͨΊʹͦΕͧΕͷॲཧΛߦ͏ w 'JFME0QFSBUJPO*OUFSGBDF w BQQMZ ΦϖϥϯυΛద༻͢Δ w NFSHF8JUI1SFWJPVT

    લͷΦϖϥϯυͱ౷ ߹͢Δ
  71. /DNCa0CKFDU w σʔλετΞͷத֩ w ͭͷϓϩύςΟ w TFSWFS%BUBαʔό͔Βऔಘͨ͠σʔλ w FTUJNBUFE%BUBΤϛϡϨʔγϣϯޙσʔλ w

    PQFSBUJPO4FUΦϖϥϯυू߹
  72. ·ͱΊ w /$.#1)14%,ʹ͍ͭͯৄࡉʹղઆ͠·ͨ͠ w 4%,͸࢖ΘΕͯͳΜ΅Ͱ͢ͷͰ࢖ͬͯΈͯԼ͍͞ w γϯϓϧͳߟ͑ํͷ"1*Ͱ΋ɺ࣮૷͢Δͷ͸Ҋ֎ େมͱ͍͏͜ͱΛࢥ͍஌Γ·ͨ͠