Home
Explore
Submit Search
Upload
Login
Signup
Advertisement
Check these out next
Tips of CakePHP and MongoDB - Cakefest2011 ichikaway
ichikaway
Agile database access with CakePHP 3
José Lorenzo Rodríguez Urdaneta
The Zen of Lithium
Nate Abele
Building Lithium Apps
Nate Abele
Lithium: The Framework for People Who Hate Frameworks
Nate Abele
Dependency injection-zendcon-2010
Fabien Potencier
PHP 5.3 and Lithium: the most rad php framework
G Woo
Lithium: The Framework for People Who Hate Frameworks, Tokyo Edition
Nate Abele
1
of
36
Top clipped slide
Introducing CakeEntity
Oct. 1, 2011
•
0 likes
3 likes
×
Be the first to like this
Show More
•
1,977 views
views
×
Total views
0
On Slideshare
0
From embeds
0
Number of embeds
0
Download Now
Download to read offline
Report
Technology
Business
CakePHPの検索でオブジェクトが返るようになるCakePHP用のプラグインの紹介
Basuke Suzuki
Follow
Software Engineer, Programmer at Kinoma
Advertisement
Advertisement
Advertisement
Recommended
Introducing CakeEntity
Basuke Suzuki
1.9K views
•
33 slides
New in cakephp3
markstory
2.1K views
•
44 slides
Advanced Querying with CakePHP 3
José Lorenzo Rodríguez Urdaneta
35.5K views
•
28 slides
Future of HTTP in CakePHP
markstory
4.3K views
•
55 slides
Nickolay Shmalenuk.Render api eng.DrupalCamp Kyiv 2011
camp_drupal_ua
1.4K views
•
24 slides
Dependency Injection IPC 201
Fabien Potencier
1.6K views
•
103 slides
More Related Content
Slideshows for you
(20)
Tips of CakePHP and MongoDB - Cakefest2011 ichikaway
ichikaway
•
7.4K views
Agile database access with CakePHP 3
José Lorenzo Rodríguez Urdaneta
•
17.9K views
The Zen of Lithium
Nate Abele
•
2.6K views
Building Lithium Apps
Nate Abele
•
5.7K views
Lithium: The Framework for People Who Hate Frameworks
Nate Abele
•
12.2K views
Dependency injection-zendcon-2010
Fabien Potencier
•
9.3K views
PHP 5.3 and Lithium: the most rad php framework
G Woo
•
5.9K views
Lithium: The Framework for People Who Hate Frameworks, Tokyo Edition
Nate Abele
•
1.6K views
The State of Lithium
Nate Abele
•
2.3K views
Jqeury ajax plugins
Inbal Geffen
•
366 views
Dependency injection in PHP 5.3/5.4
Fabien Potencier
•
37.4K views
Decouple Your Code For Reusability (International PHP Conference / IPC 2008)
Fabien Potencier
•
4.1K views
Symfony2 Building on Alpha / Beta technology
Daniel Knell
•
750 views
Doctrine For Beginners
Jonathan Wage
•
1.5K views
Dependency Injection
Rifat Nabi
•
2.7K views
Mysql & Php
Inbal Geffen
•
4.3K views
Php unit the-mostunknownparts
Bastian Feder
•
1.6K views
Separation of concerns - DPC12
Stephan Hochdörfer
•
2.3K views
50 Laravel Tricks in 50 Minutes
Azim Kurtaliev
•
1.7K views
international PHP2011_Bastian Feder_jQuery's Secrets
smueller_sandsmedia
•
418 views
Viewers also liked
(11)
CakePHP Community Keynote 2014
James Watts
•
9.5K views
CakePHP and AJAX
Mark Scherer
•
7.8K views
CakePHP mistakes made
markstory
•
2.8K views
Customize CakePHP bake
Kazuyuki Aoki
•
6.6K views
Recursive in CakePHP
Ketan Patel
•
5.2K views
PHPUnit with CakePHP and Yii
madhavi Ghadge
•
2.5K views
Top 50 Interview Questions and Answers in CakePHP
Ketan Patel
•
6.9K views
Road to CakePHP 3.0
markstory
•
11.1K views
REST API with CakePHP
Anuchit Chalothorn
•
22.1K views
RESTful Web Development with CakePHP
Andru Weir
•
11.8K views
CakePHP - Admin Acl Controlled
Luís Fred
•
6K views
Advertisement
Similar to Introducing CakeEntity
(20)
Php on the desktop and php gtk2
Elizabeth Smith
•
4.2K views
[WLDN] Supercharging word press development in 2018
Adam Tomat
•
290 views
Propel sfugmd
iKlaus
•
463 views
laravel tricks in 50minutes
Barang CK
•
390 views
SPL: The Missing Link in Development
jsmith92
•
732 views
ISUCONアプリを Pythonで書いてみた
memememomo
•
1.8K views
関西PHP勉強会 php5.4つまみぐい
Hisateru Tanaka
•
2.6K views
solving little problems
Austin Ziegler
•
1.2K views
Advanced symfony Techniques
Kris Wallsmith
•
5.4K views
The History of PHPersistence
Hugo Hamon
•
2.3K views
DRUPAL 8 STORAGES OVERVIEW
DrupalCamp Kyiv
•
3K views
php2.pptx
ElieNGOMSEU
•
4 views
Great Developers Steal
Ben Scofield
•
1.7K views
Legacy applications - 4Developes konferencja, Piotr Pasich
Piotr Pasich
•
1K views
How I started to love design patterns
Samuel ROZE
•
1.3K views
Ch8(oop)
Chhom Karath
•
176 views
Virtual Madness @ Etsy
Nishan Subedi
•
523 views
Zend Framework and the Doctrine2 MongoDB ODM (ZF1)
Ryan Mauger
•
6.2K views
Oops in php
Gourishankar R Pujar
•
782 views
Be RESTful (Symfony Camp 2008)
Fabien Potencier
•
1.2K views
More from Basuke Suzuki
(6)
CoAP Talk
Basuke Suzuki
•
4.7K views
初めての単体テスト
Basuke Suzuki
•
18.2K views
Kiosk / PHP
Basuke Suzuki
•
1.4K views
PostgreSQLからMongoDBへ
Basuke Suzuki
•
2.7K views
iOS4時代の位置情報サービスの使い方
Basuke Suzuki
•
3.1K views
iPhoneのオモチャ箱 - 刊行記念イベント@ジュンク堂新宿 - バスケ
Basuke Suzuki
•
1.1K views
Advertisement
Recently uploaded
(20)
Raspberry pi presentation.pptx
FrankAnthonyChin
•
0 views
Cloud-Native & Sustainability: How and Why to Build Sustainable Workloads
Nico Meisenzahl
•
0 views
【本科生、研究生】英国卡迪夫大学毕业证文凭购买指南
sutseu
•
0 views
Configure Network Services.pptx
YanaDangle
•
0 views
#9 Calicut MuleSoft Meetup - Munits in Mule 4.pptx
JohnMathewPhilip
•
0 views
stock.ppt
ruber731
•
0 views
fis-cn all staff 8.19.19.pptx
tamz331
•
0 views
如何办理一份高仿伦敦南岸大学毕业证成绩单?
aazepp
•
3 views
Do Reinvent the Wheel - Nov 2021 - DigiNext.pdf
Hamidreza Soleimani
•
0 views
Transverse-and-Longitudinal-Waves.pdf
AbdulRehman35508
•
0 views
【本科生、研究生】美国南达科他大学毕业证文凭购买指南
sutseu
•
0 views
【本科生、研究生】新西兰梅西大学毕业证文凭购买指南
foxupud
•
0 views
Spring_Boot_Microservices-5_Day_Session.pptx
Prabhakaran Ravichandran
•
0 views
Unit 5.pdf
BALASHANMUGAVADIVUPM
•
0 views
OODBMSvsORDBMSppt.pptx
MEHMOODNadeem
•
0 views
Introduction to Virtualization.pptx
latifdhalait
•
0 views
jenkins.pptx
Orco1
•
0 views
NS-CUK Seminar: V.T.Hoang, Review on "Graph Clustering with Graph Neural Netw...
ssuser4b1f48
•
0 views
RC522 RFID Reader_Write For Arduino.pdf
RoboDJ
•
0 views
Bosch BSG8_8100 Service Manual.pdf
ssuser78bec11
•
0 views
Introducing CakeEntity
CakeEntity The ActiveRecord
for CakePHP @basuke https://github.com/kanshin/CakeEntity
•
@basuke • Mac / iPhone / Newton • PHP : 10+ years
http://www.kanshin.com/ 2001 AssistOn http://www.assiston.co.jp/
2004 https://tabidachi.ana.co.jp/ 2006
CakeEntity •
CakePHP • Active Record Model • • GitHub • https://github.com/kanshin/CakeEntity • CakePHP 1.3, PHP 5.2 >
CakeEntity • • CakePHP 1.3.11
1.3.12 up • Smarty Cake • CakeSmarty •
Active Record ActiveRecord is
"an object that wraps a row in a database table or view, encapsulates database access and adds domain logic on that data". Fowler, 2003 http://www.martinfowler.com/books.html
Active Record
CakeEntity find $post =
$this->Post->entity(); // $post->content = "Hello world!"; $post->save(); //
CakeEntity • array()
[ ] • • • •
Prepare
first things first
entity app/plugins/entity/ or plugins/entity/
EntityModel
extends App::import('Model', 'Entity.EntityModel'); class Post extends EntityModel { ... }
Find
'entity' => true $this->Post->find('all',
array( 'conditions' => ... 'order' => ... 'entity' => true, ));
������������ $result = [
{id: 1, title:"title1", author_id:"123", ... } {id: 2, title:"title2", content:"...", } ... ]; // paginate()
// Post ->
belongsTo -> Author $this->Post->find('all', array( 'conditions' => ... 'contain' => array('Author'), 'entity' => true, ));
$result = [
{title:"title1", author: {id:3, name:"Basuke"}, ... } {title:"title2", author:null, ... } ... ]; //
hasMany // Post
-> hasMany -> Image $this->Post->find('all', array( 'conditions' => ... 'contain' => array('Image'), 'entity' => true, ));
$result = [
{title:"title1", images: [ {path:"..."}, {path:"..."}] } {title:"title2", images: [{path:"..."}, ...] } ... ]; // w
load
$post = $this->Post->find('first',
array( 'conditions' => array('id'=>$id), 'entity' => true, )); or $post = $this->Post->entityById($id);
instantiation
$post = $this->Post->entity();
$post->title = “Hello”; • $post = new PostEntity();
Save
$post->title = "Hello
world"; $post->content = file_get_content(...); if ($post->save()) { $this->isCool(); }
Entity Entity EntityModle
Entity
Entity
+ Entity entityClass()
protected function entityClassForData($data)
{ switch ($data[‘type’]) { case ‘hyper’: return ‘HyperPostEntity’; default: return ‘PlainPostEntity’; } }
isHidden(), publish()
•
$post->property_name • $post[‘property_name’] • $post->some_method() • $post[‘some_method’] • • []
{Smarty} • Smarty
{$post.property_name} • () • •
public function allows()
{ return array(); } • allows() • public
public $comments;
public function comments() { $Comment = $this->getModel()->Comment; return $Comment->find(array( ... )); } • $post[‘comments’]
CakePHP 2.0
w Many to Many
w README.md
Thanks http://d.hatena.ne.jp/basuke/
Editor's Notes
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
Advertisement