Upgrade to Pro — share decks privately, control downloads, hide ads and more …

擬人化から始めるPHPerのためのオブジェクト指向超入門

 擬人化から始めるPHPerのためのオブジェクト指向超入門

#phpcon2014

Kenichiro Kishida

October 11, 2014
Tweet

More Decks by Kenichiro Kishida

Other Decks in Programming

Transcript

  1. ΦϨ ࣾ௕ "͞Μ ൿॻ #͘Μ ࣄ຿ %͞Μ ޿ใ ࣗঀ఻ ग़ͤͳ͍͔ͳ͊

    ࣾ௕ޠ࿥ ·ͱΊͯఏग़ͯ͠ ϥΠλʔ͞Μ ͱௐ੔ΑΖ͘͠
  2. ΦϨ ࣾ௕ ৽ਓ܅ ίϐʔ܎ ͜ͽ͓ ෳࣸ܎ ιʔλ࿠ ιʔτ܎ ίϐʔ10෦ ιʔτͯ͠

    ϗονΩεࢭΊ ΑΖ͘͠ 10෦͓ئ͍͠·͢ ͓ئ͍͠·͢ ࢭΊ٢ ϗνΩε܎ ͓ئ͍͠·͢
  3. #͘Μࣄ຿ class ࣄ຿ extends Model { public $name; public function

    ޠ࿥Λه࿥͢Δ($contents) { return $this->ޠ࿥->save(....); } public function ޠ࿥Λ͢΂ͯऔಘ͢Δ() { return $this->ޠ࿥->find(‘all’); } }