Dig Deeper into WordPress - WD Meetup CairoMohamed Mosaad
Dig deeper into WordPress is a presentation made for Web Designers Meetup in Cairo taken place on 17th Dec 2012.
Signup at WPMonkeys.com to get notified when awesome new WordPress related content is published.
WordPress currently powers over 1/5th of the internet and is growing. Historically, people think of WordPress as a blogging platform or use it as a CMS, but can this tool known and used by millions of people also be used to create complex applications? WordPress is familiar, easy to use, actively developed and supported, and has a powerful codebase that allows one to quickly develop applications and websites. These things make WordPress a great option to develop you next application. We will walk through examples of WordPress's use to create applications and very complex sites and then dive into the internals of WordPress that make this happen including: Custom Data Types, WordPress Hooks, Database Interactions, Connecting to Remote APIs, The WordPress JSON API, Caching, Extensibility, User and Role Management, Templates, and URL Rewriting.
Dig Deeper into WordPress - WD Meetup CairoMohamed Mosaad
Dig deeper into WordPress is a presentation made for Web Designers Meetup in Cairo taken place on 17th Dec 2012.
Signup at WPMonkeys.com to get notified when awesome new WordPress related content is published.
WordPress currently powers over 1/5th of the internet and is growing. Historically, people think of WordPress as a blogging platform or use it as a CMS, but can this tool known and used by millions of people also be used to create complex applications? WordPress is familiar, easy to use, actively developed and supported, and has a powerful codebase that allows one to quickly develop applications and websites. These things make WordPress a great option to develop you next application. We will walk through examples of WordPress's use to create applications and very complex sites and then dive into the internals of WordPress that make this happen including: Custom Data Types, WordPress Hooks, Database Interactions, Connecting to Remote APIs, The WordPress JSON API, Caching, Extensibility, User and Role Management, Templates, and URL Rewriting.
https://speakerdeck.com/willroth/50-laravel-tricks-in-50-minutes - origin
Laravel 5.1 raised the bar for framework documentation, but there's much, much more lurking beneath the surface. In this 50-minute session, we'll explore 50 (yes, 50!) high-leverage implementation tips & tricks that you just won't find in the docs: the IoC Container, Blade, Eloquent, Middleware, Routing, Commands, Queues, Events, Caching — we'll cover them all! Join us as we drink from the fire hose & learn to take advantage of everything that Laravel has to offer to build better software faster!
Con la versione 7 di Drupal è stato introdotto il concetto di Entity, poi evoluto con la versione 8, utilizzato come base di buona parte degli elementi core (nodi, tassonomie, utenti, ...), ma - soprattutto - è stata data la possibilità di costruire entity custom. L'utilizzo di queste apre le possibilità di personalizzazione dello strumento ad un livello superiore velocizzando notevolmente lo sviluppo.
Verranno mostrate le potenzialità nell'uso delle Entity custom e le integrazioni possibili.
Top Ten Reasons to Use EntityFieldQuery in DrupalFredric Mitchell
Drupal 7 introduced a great class, EntityFieldQuery (EFQ), to easily grab information from entities that was not available in Drupal 6.
This session will explore why you should be already using EFQ in your development practices. We'll also review how to use it and explore it's relationship with Drupal view modes and block entities (Beans).
This session will also explore comparisons with Views, and how EFQ should replace some of the common development practices using Views as a query tool.
EFQ Top Ten
Core
Well Documented
Simple
Consumable
Object-Oriented
Extensible
Alterable
Exception Handling
View Modes
Beans
jQuery UI Widgets, Drag and Drop, Drupal 7 JavascriptDarren Mothersele
These are the slides from my presentation at the London Drupal Drop In December 2011. I have posted more information to go along with these slides on my <a>Drupal blog</a>.
Be lazy, be ESI: HTTP caching and Symfony2 @ PHPDay 2011 05-13-2011Alessandro Nadalin
In the first part of the presentation we see how Symfony2 implements HTTP cache.
In the second one there's an explanation of why application cache layers suck, why nerly every php application does caching in the less productive way and how you benefit from HTTP cache from this point of view.
Your code sucks, let's fix it - DPC UnConRafael Dohms
How do you measure the quality of your code? Performance and testing are just one aspect of code, in order to meet deadlines and make maintenance quicker you also need your code to be readable, decoupled and generally easier to comprehend and work with. This talk will go over tips and exercises to help you identify trouble areas, refactor them and train you to write better code in future projects. Come make your code look and function better.
Meet Magento Sweden - Magento 2 Layout and Code Compilation for PerformanceIvan Chepurnyi
It is a pity, but I have to admit, that Magento 2 has issues in layout generation process. You'll learn during the talk about the benefits of compiling XML structures into PHP code, and even use the compilation of PHP code into PHP code to speed up your modules complex logic.
A presentation on how to semi-automatically build CRUD application prototypes using PHP and some PEAR libraries. This was way before Rails became popular and automatic form generation for web applications was not as common as it is now.
Also, it was the first public presentation I ever held. Ah, those were the times ;-)
Originally held at the International PHP Conference 2004 in Amsterdam, although these slides have been updated by project contributors to reflect feature additions that were implemented later.
Caching is one of the most popular ways to optimize the performance of web applications. Magento is not far from this trend and the primary approach to speed up slow code from the core team is to cache it. This approach works well for small projects where the rate of inventory changes is shallow. But as soon as you enter sales season or receive regular product updates from the external system, your cache hit ratio plummets. In this talk, you will learn how to ensure that your system’s uncached response times are as light as possible when you get a cache miss by minimizing the I/O of your application with intelligent batch data preloading.
Powerpoint file(incl. animations!): http://db.tt/ktTDiQSG
Demostration module with example: http://db.tt/Ix2ovTno
This is the slides of the presentation "Drupal & Javascript" who presented at DrupalCamp Israel 2012.
Drupal is Stupid (But I Love It Anyway)brockboland
Regrettably, my machine didn't cooperate when I tried to record this presentation. I don't think the slides will do you much good without the stuff I said, but a few people asked for them.
---
Depending on who you ask, Drupal is either a framework or a platform, but no matter how you look at it, there are things about it that suck. Hear Brock Boland talk about the pain points of coding for Drupal 6, how things have improved in Drupal 7, and what's expected to be better in Drupal 8.
https://speakerdeck.com/willroth/50-laravel-tricks-in-50-minutes - origin
Laravel 5.1 raised the bar for framework documentation, but there's much, much more lurking beneath the surface. In this 50-minute session, we'll explore 50 (yes, 50!) high-leverage implementation tips & tricks that you just won't find in the docs: the IoC Container, Blade, Eloquent, Middleware, Routing, Commands, Queues, Events, Caching — we'll cover them all! Join us as we drink from the fire hose & learn to take advantage of everything that Laravel has to offer to build better software faster!
Con la versione 7 di Drupal è stato introdotto il concetto di Entity, poi evoluto con la versione 8, utilizzato come base di buona parte degli elementi core (nodi, tassonomie, utenti, ...), ma - soprattutto - è stata data la possibilità di costruire entity custom. L'utilizzo di queste apre le possibilità di personalizzazione dello strumento ad un livello superiore velocizzando notevolmente lo sviluppo.
Verranno mostrate le potenzialità nell'uso delle Entity custom e le integrazioni possibili.
Top Ten Reasons to Use EntityFieldQuery in DrupalFredric Mitchell
Drupal 7 introduced a great class, EntityFieldQuery (EFQ), to easily grab information from entities that was not available in Drupal 6.
This session will explore why you should be already using EFQ in your development practices. We'll also review how to use it and explore it's relationship with Drupal view modes and block entities (Beans).
This session will also explore comparisons with Views, and how EFQ should replace some of the common development practices using Views as a query tool.
EFQ Top Ten
Core
Well Documented
Simple
Consumable
Object-Oriented
Extensible
Alterable
Exception Handling
View Modes
Beans
jQuery UI Widgets, Drag and Drop, Drupal 7 JavascriptDarren Mothersele
These are the slides from my presentation at the London Drupal Drop In December 2011. I have posted more information to go along with these slides on my <a>Drupal blog</a>.
Be lazy, be ESI: HTTP caching and Symfony2 @ PHPDay 2011 05-13-2011Alessandro Nadalin
In the first part of the presentation we see how Symfony2 implements HTTP cache.
In the second one there's an explanation of why application cache layers suck, why nerly every php application does caching in the less productive way and how you benefit from HTTP cache from this point of view.
Your code sucks, let's fix it - DPC UnConRafael Dohms
How do you measure the quality of your code? Performance and testing are just one aspect of code, in order to meet deadlines and make maintenance quicker you also need your code to be readable, decoupled and generally easier to comprehend and work with. This talk will go over tips and exercises to help you identify trouble areas, refactor them and train you to write better code in future projects. Come make your code look and function better.
Meet Magento Sweden - Magento 2 Layout and Code Compilation for PerformanceIvan Chepurnyi
It is a pity, but I have to admit, that Magento 2 has issues in layout generation process. You'll learn during the talk about the benefits of compiling XML structures into PHP code, and even use the compilation of PHP code into PHP code to speed up your modules complex logic.
A presentation on how to semi-automatically build CRUD application prototypes using PHP and some PEAR libraries. This was way before Rails became popular and automatic form generation for web applications was not as common as it is now.
Also, it was the first public presentation I ever held. Ah, those were the times ;-)
Originally held at the International PHP Conference 2004 in Amsterdam, although these slides have been updated by project contributors to reflect feature additions that were implemented later.
Caching is one of the most popular ways to optimize the performance of web applications. Magento is not far from this trend and the primary approach to speed up slow code from the core team is to cache it. This approach works well for small projects where the rate of inventory changes is shallow. But as soon as you enter sales season or receive regular product updates from the external system, your cache hit ratio plummets. In this talk, you will learn how to ensure that your system’s uncached response times are as light as possible when you get a cache miss by minimizing the I/O of your application with intelligent batch data preloading.
Powerpoint file(incl. animations!): http://db.tt/ktTDiQSG
Demostration module with example: http://db.tt/Ix2ovTno
This is the slides of the presentation "Drupal & Javascript" who presented at DrupalCamp Israel 2012.
Drupal is Stupid (But I Love It Anyway)brockboland
Regrettably, my machine didn't cooperate when I tried to record this presentation. I don't think the slides will do you much good without the stuff I said, but a few people asked for them.
---
Depending on who you ask, Drupal is either a framework or a platform, but no matter how you look at it, there are things about it that suck. Hear Brock Boland talk about the pain points of coding for Drupal 6, how things have improved in Drupal 7, and what's expected to be better in Drupal 8.
Utilization of zend an ultimate alternate for intense data processingCareer at Elsner
Normally, you can
write raw php/mysql functionality for your requirements, but if you wish to keep your code
clean and reusable, using Zend functionality is the way. Magento development company use
the Zend framework.
Would you like to make your Android UI code cleaner and more reactive? Android data binding can help. In this talk you’ll learn everything you need to know about data binding, including why it’s so powerful and how to use it effectively. If you haven’t tried data binding in the past, that’s okay! We’ll start with the basics, assuming no prior knowledge and slowly move into more advanced topics, such as 2-way binding, binding adapters, converters, best practices and common pitfalls to avoid.
Come to this talk prepared to learn about the Doctrine PHP open source project. The Doctrine project has been around for over a decade and has evolved from database abstraction software that dates back to the PEAR days. The packages provided by the Doctrine project have been downloaded almost 500 million times from packagist. In this talk we will take you through how to get started with Doctrine and how to take advantage of some of the more advanced features.
As present at FluentConf 2014 on March 11th, 2014.
AngularJS is one of the most popular, and powerful, JavaScript frameworks for building rich client-side applications. AngularJS is both simultaneously both simple to use and extremely full featured. With AngularJS a little goes a long way, but to make the most of it, you need to know what you’re doing.
In this workshop we will build a complex application to help exercise all of the salient points of the AngularJS framework.
Topics covered include, ngResource, directives, fitlers, routing, templates, controllers, testing, and more.
Code can be found at: https://github.com/markbates/fluent-2014
With a very low barrier to entry, developing with WordPress has become particularly popular in the past few years. However, this sometimes means that standards and best practices aren’t well respected.
This talk will cover WordPress coding standards, best practices, and technical tools to become a better developer. This will be a resourceful presentation for anyone beginning, interested in, and those who have been developing with WordPress for a long time. Some of the topics covered will be proper usage of hooks and filters, creating your own plugins (instead of always using that functions.php), making use of the mu-plugins folder, how to properly escape and sanitize user-generated content, security gotchas and more.
The talk is geared at beginning developers as much as it is for advanced developers. Basic php knowledge is strongly recommended, though not required.
"Impact of front-end architecture on development cost", Viktor TurskyiFwdays
I have heard many times that architecture is not important for the front-end. Also, many times I have seen how developers implement features on the front-end just following the standard rules for a framework and think that this is enough to successfully launch the project, and then the project fails. How to prevent this and what approach to choose? I have launched dozens of complex projects and during the talk we will analyze which approaches have worked for me and which have not.
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
As AI technology is pushing into IT I was wondering myself, as an “infrastructure container kubernetes guy”, how get this fancy AI technology get managed from an infrastructure operational view? Is it possible to apply our lovely cloud native principals as well? What benefit’s both technologies could bring to each other?
Let me take this questions and provide you a short journey through existing deployment models and use cases for AI software. On practical examples, we discuss what cloud/on-premise strategy we may need for applying it to our own infrastructure to get it to work from an enterprise perspective. I want to give an overview about infrastructure requirements and technologies, what could be beneficial or limiting your AI use cases in an enterprise environment. An interactive Demo will give you some insides, what approaches I got already working for real.
Neuro-symbolic is not enough, we need neuro-*semantic*Frank van Harmelen
Neuro-symbolic (NeSy) AI is on the rise. However, simply machine learning on just any symbolic structure is not sufficient to really harvest the gains of NeSy. These will only be gained when the symbolic structures have an actual semantics. I give an operational definition of semantics as “predictable inference”.
All of this illustrated with link prediction over knowledge graphs, but the argument is general.
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Search and Society: Reimagining Information Access for Radical FuturesBhaskar Mitra
The field of Information retrieval (IR) is currently undergoing a transformative shift, at least partly due to the emerging applications of generative AI to information access. In this talk, we will deliberate on the sociotechnical implications of generative AI for information access. We will argue that there is both a critical necessity and an exciting opportunity for the IR community to re-center our research agendas on societal needs while dismantling the artificial separation between the work on fairness, accountability, transparency, and ethics in IR and the rest of IR research. Instead of adopting a reactionary strategy of trying to mitigate potential social harms from emerging technologies, the community should aim to proactively set the research agenda for the kinds of systems we should build inspired by diverse explicitly stated sociotechnical imaginaries. The sociotechnical imaginaries that underpin the design and development of information access technologies needs to be explicitly articulated, and we need to develop theories of change in context of these diverse perspectives. Our guiding future imaginaries must be informed by other academic fields, such as democratic theory and critical theory, and should be co-developed with social science scholars, legal scholars, civil rights and social justice activists, and artists, among others.
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
2. Akeda Bagus
• Code wrangler at
Automattic.
• Currently working on
WooCommerce
extensions and
marketplace.
3. CRUD and Data Store
in WooCommerce?
Why we need that?
4. Create, Read, Update, Delete
• WooCommerce has some resource types: orders, products, customers,
coupons, etc.
• With CRUD in resource, the developer doesn’t need to know the internal
complexities when interacting with WooCommerce resource types.
• Increase DRY. It can be used in WooCommerce REST API and CLIs.
• Once abstracted, the underlying data storage of resource can be
anything (CPT, custom table, external service, or dummy storage).
• Increase test coverage.
• For more detail see https://woocommerce.wordpress.com/2016/10/27/
the-new-crud-classes-in-woocommerce-2-7/.
6. Resource Interaction
without Data CRUD
• Developer needs to know WooCommerce meta
keys and expected value’s type to store for each
resource type.
• Data storage is tied to WP tables.
• Unit test needs to be set up with the test DB unless
all WP dependencies are mocked.
8. Resource Interaction
with Data CRUD
• Developer only needs to know the Data CRUD
methods.
• Data CRUD objects handle flow of data and any
validations. Less work for developers!
• Easier to test the resource.
9. Resource Interaction
with Data CRUD
// Setters and getters on the resource.
// Basically set_{property} and get_{property}.
$product = wc_get_product( 123 );
$product->set_description( ‘My cool product’ );
$product->set_sku( ‘WOO123’ );
$product->set_price( 15000 );
$product->get_description(); // My cool product
$product->get_sku(); // WOO123
$product->get_price(); // 15000
10. Resource Interaction
with Data CRUD
// Saving and deleting with save() and delete().
$product = wc_get_product( 123 );
$product->set_price( 25000 );
// Internally, this will pass the action to the data store to
// persist the change. If no ID, it implies creation otherwise
// it will update existing product.
$product->save();
// This will delete the product from the DB.
$product->delete();
11. Resource Interaction
with Data CRUD
• All properties on resource types can be found at WooCommerce
GitHub’s wiki.
• https://github.com/woocommerce/woocommerce/wiki/CRUD-Objects-
in-3.0
• Once you know available properties, the pattern is easy to remember:
• get_{property} to retrieve the property.
• set_{property} to set the property.
• Use save() and delete() to create/update and delete the
resource.
12. Resource Interaction
with Data CRUD
• All Data CRUD objects must extend abstract WC_Data.
• WC_Data handles the communication with the data store, so the
implementation only needs to extend the abstract and define some
properties that are available via setters and getters.
• Examples of WooCommerce Data CRUD classes:
• WC_Coupon
• WC_Order
• WC_Product
• WC_Customer
13. Data Store
• Bridge Data CRUDs and storage layer.
• If Data CRUDs need data, they ask Data Store.
Same thing when saving and deleting.
• Data Store can be powered by CPT, custom table,
remote API, or anything. It’s easy to swap the data
store of a Data CRUD class.
• WooCommerce built-in Data CRUDs are shipped
with CPT and custom table Data Store.
14. Data Store
• Data Store should be started by defining interface. The implementation can
be CPT, custom table, external API, or anything.
• Methods defined in the interface can be create(), read(),
read_meta(), delete_meta(), etc.
• Every Data Store for Data CRUD object should implement that interface. For
CPT, the create() could use wp_insert_post(), while for external API
the create() could use wp_remote_post().
• A method may accepts reference to $data, which has a type of WC_Data.
• For more detail see https://github.com/woocommerce/woocommerce/wiki/
Data-Stores.
15. Data Store
// Example of Data Store interface.
interface WC_Object_Data_Store_Interface {
public function create( &$data );
public function read( &$data );
public function update( &$data );
public function delete( &$data, $args = array() );
public function read_meta( &$data );
public function delete_meta( &$data, $meta );
public function add_meta( &$data, $meta );
public function update_meta( &$data, $meta );
}
16. Data Store
// Example create() method from Coupon CPT Data Store. With CPT
// as the underlying storage, create() uses wp_insert_post().
public function create( WC_Coupon &$coupon ) {
// ...
$coupon_id = wp_insert_post( [
‘post_type’ => ‘shop_coupon’,
‘post_title’ => $coupon->get_code(),
// ...
] );
if ( $coupon_id ) {
$coupon->set_id( $coupon_id );
// ...
}
}
17. Data Store
// Example delete_order_item() method from order item
// Data Store which uses custom table.
public function delete_order_item( $item_id ) {
global $wpdb;
$wpdb->query( /* ... */ );
$wpdb->query( /* ... */ );
}
18. Data Store
// Example create() with external API request.
public function create( WC_Data &$data ) {
// ...
$result = wp_remote_post( /* ... */ );
if ( ! empty( $result[‘id’] ) ) {
$data->set_id( $result[‘id’] );
}
// ...
}
23. Creating your own CRUD
in your extension (CPT Data Store)
• Let’s use Restaurant as an example of a custom resource.
• First, define some properties that a Restaurant needs. For example:
• Name
• Address
• Cuisine
• Opening hours
• Map the properties in the CRUD class.
• Start Restaurant data store by using CPT as the underlying storage.
24. Creating your own CRUD
in your extension (CPT Data Store)
namespace GedexWCJKTRestaurantData_Objects;
class Restaurant extends WC_Data {
// Name value pairs (name => default value).
protected $data = [
‘name’ => ‘’,
‘address’ => ‘’,
‘cuisine’ => ‘’,
‘opening_hours’ => ‘9am - 10pm’,
];
public function __construct( $restaurant = 0 ) { ... }
public function get_name( $context = ‘view’ ) { ... }
public function set_name( $name ) { ... }
}
25. Creating your own CRUD
in your extension (CPT Data Store)
namespace GedexWCJKTRestaurantData_Objects;
class Restaurant extends WC_Data {
public function __construct( $restaurant = 0 ) {
parent::__construct( $restaurant );
if ( is_numeric( $restaurant ) && $restaurant > 0 ) {
$this->set_id( $restaurant );
} elseif ( $restaurant instanceof self ) {
$this->set_id( $restaurant->get_id() );
} else if ( ! empty( $restaurant->ID ) ) {
$this->set_id( $restaurant->ID );
} else {
$this->set_object_read( true );
}
$this->data_store = WC_Data_Store::load( ‘restaurant’ );
if ( $this->get_id() > 0 ) {
$this->data_store->read( $this );
}
}
}
26. Creating your own CRUD
in your extension (CPT Data Store)
namespace GedexWCJKTRestaurantData_Objects;
class Restaurant extends WC_Data {
public function get_name( $context = ‘view’ ) {
return $this->get_prop( ‘name’, $context );
}
public function set_name( $name ) {
$this->set_prop( ‘name’, $name )
}
// Do the same for other properties.
// ...
}
27. Creating your own CRUD
in your extension (CPT Data Store)
namespace GedexWCJKTRestaurantData_Stores;
use GedexWCJKTRestaurantData_ObjectsRestaurant;
interface Restaurant_Interface {
public function create( Restaurant &$restaurant );
public function read( Restaurant &$restaurant );
public function update( Restaurant &$restaurant );
public function delete( Restaurant &$restaurant );
}
28. Creating your own CRUD
in your extension (CPT Data Store)
namespace GedexWCJKTRestaurantData_Stores;
use GedexWCJKTRestaurantData_ObjectsRestaurant;
class Restaurant_CPT extends WC_Data_Store_WP
implements Restaurant_Interface
{
public function create( Restaurant &$restaurant ) { }
public function read( Restaurant &$restaurant ) { }
public function update( Restaurant &$restaurant ) { }
public function delete( Restaurant &$restaurant ) { }
}
29. Creating your own CRUD
in your extension (CPT Data Store)
• Let’s see in action.
30. More Information for Data CRUD and Data
Store
• https://github.com/woocommerce/woocommerce/wiki/
CRUD-Objects-in-3.0
• https://github.com/woocommerce/woocommerce/wiki/
Data-Stores
• Order with custom table is scheduled in Q1 2018. See
the roadmap: https://trello.com/c/2QGrEbBW/113-an-
order-database-that-can-scale-feature-plugin.
• If you develop WooCommerce extension make sure it’s
ready for this.