SlideShare a Scribd company logo
1 of 18
CAKEPHP 3
Fundamentals,ORM and Security
Tarikul Islam
Senior PHP Developer at Oceanize Inc.
By
Why CakePHP 3 ?
■ Rich ORM,
■ Zero configuration (Convention Over Configuration)
■ Easily extend with Components, Helpers, Behaviours and Plug-ins
■ Build in validation
■ ACL Functionality and Security
■ CRUD scaffolding
■ Ability to create tests
■ Less coding time
Naming Convention Database
■ Table names are plural and underscored (users, user_favorite_pages)
■ Field names with two or more words are underscored: first_name
■ Foreign keys in hasMany, belongsTo/hasOne relationships are recognized by default as
the (singular) name of the related table followed by “_id”
■ article_categories whose name contains multiple words, the foreign key would be
article_category_id
■ RelationalTable will be both plural and underscored like articles_tags.
■ Arranged in alphabetical order (articles_tags rather than tags_articles)
Associations
Vs
Database Relations
■ User hasMany Bookmarks
■ Bookmarks belogsTo Users
■ Bookmarks belongsToManyTags
■ Tags belongsToMany Bookmarks
Summary of Naming Convention
■ Database table: “articles”
■ Table class:ArticlesTable, found at src/Model/Table/ArticlesTable.php
■ Entity class:Article, found at src/Model/Entity/Article.php
■ Controller class:ArticlesController, found at src/Controller/ArticlesController.php
■ View template, found at src/Template/Articles/index.ctp
Entity
Table
CakePHP ORM
■ Table
– The database tables or collection of entities
■ Entities
– A database row or a collection of data that make up a
single record
Table Domain
■ Associations
■ Behaviors
■ Validation
■ Communicate with Database
Entities Domain
■ Data for that Instance
■ Make virtual fields
■ Accessible and unaccusable fields
CakePHP query
■ How to Get data from table or Controller
■ Different Finder methods
■ Get relational data
■ Get data by relational call
Associations
Vs
Retrieve Data
Relations hasMany
Vs
Relations BelongsTo
Vs
Security
■ Authentication & Authorization
■ Sensitive data should be Unaccusable
■ CSRF Protection
■ Checking Proper Data request
■ Prevent easy access by changing url or making fake request
ThankYou
I am available on
Facebook : fb.com/tarikul05
Twitter : twitter.com/tarikul05
Github : github.com/tarikul05
Stackoverflow : stackoverflow.com/u/3278789

More Related Content

Similar to Fundamentals, ORM and Security

Managing Applications in CodeIgniter
Managing Applications in CodeIgniterManaging Applications in CodeIgniter
Managing Applications in CodeIgniter
Jamshid Hashimi
 
Naming conventions
Naming conventionsNaming conventions
Naming conventions
Mao Hieng
 

Similar to Fundamentals, ORM and Security (20)

Unit 10
Unit 10Unit 10
Unit 10
 
A Practical Multi-Tenant Cluster
A Practical Multi-Tenant ClusterA Practical Multi-Tenant Cluster
A Practical Multi-Tenant Cluster
 
Information Retrieval - Data Science Bootcamp
Information Retrieval - Data Science BootcampInformation Retrieval - Data Science Bootcamp
Information Retrieval - Data Science Bootcamp
 
MySQL Fulltext Search Tutorial
MySQL Fulltext Search TutorialMySQL Fulltext Search Tutorial
MySQL Fulltext Search Tutorial
 
My sql
My sqlMy sql
My sql
 
Managing Applications in CodeIgniter
Managing Applications in CodeIgniterManaging Applications in CodeIgniter
Managing Applications in CodeIgniter
 
Presentation 5 (4).pdf
Presentation 5 (4).pdfPresentation 5 (4).pdf
Presentation 5 (4).pdf
 
Insight Data Engineering project
Insight Data Engineering projectInsight Data Engineering project
Insight Data Engineering project
 
Being RDBMS Free -- Alternate Approaches to Data Persistence
Being RDBMS Free -- Alternate Approaches to Data PersistenceBeing RDBMS Free -- Alternate Approaches to Data Persistence
Being RDBMS Free -- Alternate Approaches to Data Persistence
 
Creating a RESTful api without losing too much sleep
Creating a RESTful api without losing too much sleepCreating a RESTful api without losing too much sleep
Creating a RESTful api without losing too much sleep
 
Using Document Databases with TYPO3 Flow
Using Document Databases with TYPO3 FlowUsing Document Databases with TYPO3 Flow
Using Document Databases with TYPO3 Flow
 
Why Drupal is Rockstar?
Why Drupal is Rockstar?Why Drupal is Rockstar?
Why Drupal is Rockstar?
 
[Azure Governance] Lesson 1 : Azure Naming Convention
[Azure Governance] Lesson 1 : Azure Naming Convention[Azure Governance] Lesson 1 : Azure Naming Convention
[Azure Governance] Lesson 1 : Azure Naming Convention
 
Introduction to firebidSQL 3.x
Introduction to firebidSQL 3.xIntroduction to firebidSQL 3.x
Introduction to firebidSQL 3.x
 
What's New in Apache Hive
What's New in Apache HiveWhat's New in Apache Hive
What's New in Apache Hive
 
Naming conventions
Naming conventionsNaming conventions
Naming conventions
 
Mule soft meetup_4_mty_online_oct_2020
Mule soft meetup_4_mty_online_oct_2020Mule soft meetup_4_mty_online_oct_2020
Mule soft meetup_4_mty_online_oct_2020
 
File system interface
File system interfaceFile system interface
File system interface
 
IT glossary
IT glossaryIT glossary
IT glossary
 
Database Systems Security
Database Systems SecurityDatabase Systems Security
Database Systems Security
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate Guide
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Choreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software EngineeringChoreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software Engineering
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
 
ChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps Productivity
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
API Governance and Monetization - The evolution of API governance
API Governance and Monetization -  The evolution of API governanceAPI Governance and Monetization -  The evolution of API governance
API Governance and Monetization - The evolution of API governance
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 

Fundamentals, ORM and Security

  • 1. CAKEPHP 3 Fundamentals,ORM and Security Tarikul Islam Senior PHP Developer at Oceanize Inc. By
  • 2.
  • 3. Why CakePHP 3 ? ■ Rich ORM, ■ Zero configuration (Convention Over Configuration) ■ Easily extend with Components, Helpers, Behaviours and Plug-ins ■ Build in validation ■ ACL Functionality and Security ■ CRUD scaffolding ■ Ability to create tests ■ Less coding time
  • 4. Naming Convention Database ■ Table names are plural and underscored (users, user_favorite_pages) ■ Field names with two or more words are underscored: first_name ■ Foreign keys in hasMany, belongsTo/hasOne relationships are recognized by default as the (singular) name of the related table followed by “_id” ■ article_categories whose name contains multiple words, the foreign key would be article_category_id ■ RelationalTable will be both plural and underscored like articles_tags. ■ Arranged in alphabetical order (articles_tags rather than tags_articles)
  • 6. Database Relations ■ User hasMany Bookmarks ■ Bookmarks belogsTo Users ■ Bookmarks belongsToManyTags ■ Tags belongsToMany Bookmarks
  • 7. Summary of Naming Convention ■ Database table: “articles” ■ Table class:ArticlesTable, found at src/Model/Table/ArticlesTable.php ■ Entity class:Article, found at src/Model/Entity/Article.php ■ Controller class:ArticlesController, found at src/Controller/ArticlesController.php ■ View template, found at src/Template/Articles/index.ctp
  • 9. CakePHP ORM ■ Table – The database tables or collection of entities ■ Entities – A database row or a collection of data that make up a single record
  • 10. Table Domain ■ Associations ■ Behaviors ■ Validation ■ Communicate with Database
  • 11. Entities Domain ■ Data for that Instance ■ Make virtual fields ■ Accessible and unaccusable fields
  • 12. CakePHP query ■ How to Get data from table or Controller ■ Different Finder methods ■ Get relational data ■ Get data by relational call
  • 17. Security ■ Authentication & Authorization ■ Sensitive data should be Unaccusable ■ CSRF Protection ■ Checking Proper Data request ■ Prevent easy access by changing url or making fake request
  • 18. ThankYou I am available on Facebook : fb.com/tarikul05 Twitter : twitter.com/tarikul05 Github : github.com/tarikul05 Stackoverflow : stackoverflow.com/u/3278789