Lithium: The Framework for People Who Hate FrameworksNate Abele
This is the presentation was given at ConFoo on March 11th by Nate Abele and Joël Perras, and is an introduction to the architectural problems with other frameworks that Lithium was designed to address, and how it addresses them. It also introduces programming paradigms like functional and aspect-oriented programming which address issues that OOP doesn't account for.
Finally, the talk provides a quick overview of the innovative and unparalleled features that Lithium provides, including the data layer, which supports both relational and non-relational databases.
This talk is an overview of the history of the PHP language and major framework projects that have emerged in the last 5 years. It examines what we've learned in the development of these frameworks, how that education has been brought to bear in Lithium. Most of this talk ended up being me demoing and answering questions, so there's not a lot of content in the slides, sorry.
Lithium: The Framework for People Who Hate FrameworksNate Abele
This is the presentation was given at ConFoo on March 11th by Nate Abele and Joël Perras, and is an introduction to the architectural problems with other frameworks that Lithium was designed to address, and how it addresses them. It also introduces programming paradigms like functional and aspect-oriented programming which address issues that OOP doesn't account for.
Finally, the talk provides a quick overview of the innovative and unparalleled features that Lithium provides, including the data layer, which supports both relational and non-relational databases.
This talk is an overview of the history of the PHP language and major framework projects that have emerged in the last 5 years. It examines what we've learned in the development of these frameworks, how that education has been brought to bear in Lithium. Most of this talk ended up being me demoing and answering questions, so there's not a lot of content in the slides, sorry.
Un gioco in cui vincono tutti o due piccioni con una fava ;)
Lavorare rivolti alla creazione di valore per il cliente e da questo ottenere una libreria quasi pronta per essere pubblicata
Adding Dependency Injection to Legacy ApplicationsSam Hennessy
Dependency Injection (DI) is a fantastic technique, but what if you what to use dependency injection in your legacy application. Fear not! As someone who as done this very thing, I will show how you can successful and incrementally add DI to any application. I will present a number of recipes and solutions to common problems and give a tour of the various PHP DI projects and how they can help.
Durian: a PHP 5.5 microframework with generator-style middlewareKuan Yen Heng
Durian utilizes the newest features of PHP 5.4 and 5.5 as well as lightweight library components to create an accessible, compact framework with performant routing and flexible generator-style middleware.
What should you test with your unit tests? Some people will say that unit behaviour is best tested through it's outcomes. But what if communication between units itself is more important than the results of it? This session will introduce you to two different ways of unit-testing and show you a way to assert your object behaviours through their communications.
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.
Programación funcional con swift. Se ven conceptos como funciones de primera clase, funciones de orden superior, métodos como filter, map y el patrón Result para la gestión de errores.
All projects start with a lot of enthusiasm. As many projects grow the technical debt gets bigger and the enthusiasm gets less. Almost any developer can develop a great project, but the key is maintaining an ever evolving application with minimal technical debt without loosing enthusiasm.
During this talk you will be taken on the journey of application design. The starting point is an application that looks fine but contains lots of potential pitfalls. We will address the problems and solve them with beautiful design. We end up with testable, nicely separated software with a clear intention.
You’ve seen Kris’ open source libraries, but how does he tackle coding out an application? Walk through green fields with a Symfony expert as he takes his latest “next big thing” idea from the first line of code to a functional prototype. Learn design patterns and principles to guide your way in organizing your own code and take home some practical examples to kickstart your next project.
Un gioco in cui vincono tutti o due piccioni con una fava ;)
Lavorare rivolti alla creazione di valore per il cliente e da questo ottenere una libreria quasi pronta per essere pubblicata
Adding Dependency Injection to Legacy ApplicationsSam Hennessy
Dependency Injection (DI) is a fantastic technique, but what if you what to use dependency injection in your legacy application. Fear not! As someone who as done this very thing, I will show how you can successful and incrementally add DI to any application. I will present a number of recipes and solutions to common problems and give a tour of the various PHP DI projects and how they can help.
Durian: a PHP 5.5 microframework with generator-style middlewareKuan Yen Heng
Durian utilizes the newest features of PHP 5.4 and 5.5 as well as lightweight library components to create an accessible, compact framework with performant routing and flexible generator-style middleware.
What should you test with your unit tests? Some people will say that unit behaviour is best tested through it's outcomes. But what if communication between units itself is more important than the results of it? This session will introduce you to two different ways of unit-testing and show you a way to assert your object behaviours through their communications.
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.
Programación funcional con swift. Se ven conceptos como funciones de primera clase, funciones de orden superior, métodos como filter, map y el patrón Result para la gestión de errores.
All projects start with a lot of enthusiasm. As many projects grow the technical debt gets bigger and the enthusiasm gets less. Almost any developer can develop a great project, but the key is maintaining an ever evolving application with minimal technical debt without loosing enthusiasm.
During this talk you will be taken on the journey of application design. The starting point is an application that looks fine but contains lots of potential pitfalls. We will address the problems and solve them with beautiful design. We end up with testable, nicely separated software with a clear intention.
You’ve seen Kris’ open source libraries, but how does he tackle coding out an application? Walk through green fields with a Symfony expert as he takes his latest “next big thing” idea from the first line of code to a functional prototype. Learn design patterns and principles to guide your way in organizing your own code and take home some practical examples to kickstart your next project.
"Dependency injection" (DI) seems like one of those hot buzzwords that will solve all your problems. But what is DI really? How does it help keep code clean and maintainable? And how do you take a legacy codebase and rewrite it to take advantage of DI? This talk takes an application written without DI and walks through the steps for "injecting" DI into the code. Learn the difference between "dependency injection" and "dependency injection containers". See how DI makes things like event-driven architectures simple to implement. And learn how DI leads to code that is easier to debug and test.
Drupal 8 Services And Dependency InjectionPhilip Norton
Using the service manager is an essential part of a Drupal 8 developers toolkit and understanding it not only helps development, but can also allow you to create modules that can be easily used by other developers. There are numerous code examples out there that talk about using this or that service, so I'll look at how to go from "\Drupal::service('thing');" to finding and using services within Drupal 8. I will look at creating custom services to use within your own modules and provide injectable dependencies for other modules. I will also show how to override services to provide your own functionality to existing services. All code shown will be real examples that you can take away and use in your own projects.
Given at DrupalCamp London 2018
Refactoring, Agile Entwicklung, Continuous Integration – all diese für nachhaltigen Erfolg wichtigen Vorgehensweisen setzen Erfahrung mit Unit Testing voraus. Abseits von den üblichen "Bowling"-Beispielen möchten wir gerne einen Crashkurs inkl. Best Practices für das erfolgreiche Unit Testing durchführen. Anhand eines Beispielprojekts auf Basis des Zend Frameworks werden wir nach der Installation von PHPUnit auf allen Notebooks gemeinsam eine kleine Applikation aufbauen, die durchgehend Test-driven entwickelt wird.
4Developers 2015: Be pragmatic, be SOLID - Krzysztof MenżykPROIDEA
Krzysztof Menżyk
Language: Polish
Wiemy jak projektować dobry kod obiektowy? Ilu z nas zna 5 zasad SOLID? Ilu z nas przestrzega ich w codziennej pracy z kodem? Nie tylko wyjaśnię co to SOLID, ale również pokażę, że to nie sucha teoria a praktyczne rady, które warto aplikować w naszych projektach.
Podczas prezentacji szczegółowo omówię każdą z pięciu zasad. Pokażę konkretne przykłady, które naruszają ww. zasady. Zaprezentuję przykładowe rozwiązania i techniki refaktorowania kodu. Omówię również, w jakich sytuacjach można pominąć niektóre z zasad oraz jaki może to mieć wpływ na projekt.
Харьковский WordPress MeetUp #2: http://wp.org.ua/?p=191
Какими навыками должен обладать WordPress Гуру (junior, middle, senior) и какие этапы роста проходит WP-разработчик, а также опишет путь от настройки простейшего блога для друга и мелкого фриланса до участия в масштабных Open Source проектах и карьеры в крупной компании. Доклад даст нужное направление для развития новичкам и поможет упорядочить мысли более опытным разработчикам.
Видео будет доступно немного позже.
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfPeter Spielvogel
Building better applications for business users with SAP Fiori.
• What is SAP Fiori and why it matters to you
• How a better user experience drives measurable business benefits
• How to get started with SAP Fiori today
• How SAP Fiori elements accelerates application development
• How SAP Build Code includes SAP Fiori tools and other generative artificial intelligence capabilities
• How SAP Fiori paves the way for using AI in SAP apps
Welcome to the first live UiPath Community Day Dubai! Join us for this unique occasion to meet our local and global UiPath Community and leaders. You will get a full view of the MEA region's automation landscape and the AI Powered automation technology capabilities of UiPath. Also, hosted by our local partners Marc Ellis, you will enjoy a half-day packed with industry insights and automation peers networking.
📕 Curious on our agenda? Wait no more!
10:00 Welcome note - UiPath Community in Dubai
Lovely Sinha, UiPath Community Chapter Leader, UiPath MVPx3, Hyper-automation Consultant, First Abu Dhabi Bank
10:20 A UiPath cross-region MEA overview
Ashraf El Zarka, VP and Managing Director MEA, UiPath
10:35: Customer Success Journey
Deepthi Deepak, Head of Intelligent Automation CoE, First Abu Dhabi Bank
11:15 The UiPath approach to GenAI with our three principles: improve accuracy, supercharge productivity, and automate more
Boris Krumrey, Global VP, Automation Innovation, UiPath
12:15 To discover how Marc Ellis leverages tech-driven solutions in recruitment and managed services.
Brendan Lingam, Director of Sales and Business Development, Marc Ellis
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.
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
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
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
In his public lecture, Christian Timmerer provides insights into the fascinating history of video streaming, starting from its humble beginnings before YouTube to the groundbreaking technologies that now dominate platforms like Netflix and ORF ON. Timmerer also presents provocative contributions of his own that have significantly influenced the industry. He concludes by looking at future challenges and invites the audience to join in a discussion.
A tale of scale & speed: How the US Navy is enabling software delivery from l...sonjaschweigert1
Rapid and secure feature delivery is a goal across every application team and every branch of the DoD. The Navy’s DevSecOps platform, Party Barge, has achieved:
- Reduction in onboarding time from 5 weeks to 1 day
- Improved developer experience and productivity through actionable findings and reduction of false positives
- Maintenance of superior security standards and inherent policy enforcement with Authorization to Operate (ATO)
Development teams can ship efficiently and ensure applications are cyber ready for Navy Authorizing Officials (AOs). In this webinar, Sigma Defense and Anchore will give attendees a look behind the scenes and demo secure pipeline automation and security artifacts that speed up application ATO and time to production.
We will cover:
- How to remove silos in DevSecOps
- How to build efficient development pipeline roles and component templates
- How to deliver security artifacts that matter for ATO’s (SBOMs, vulnerability reports, and policy evidence)
- How to streamline operations with automated policy checks on container images
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfPaige Cruz
Monitoring and observability aren’t traditionally found in software curriculums and many of us cobble this knowledge together from whatever vendor or ecosystem we were first introduced to and whatever is a part of your current company’s observability stack.
While the dev and ops silo continues to crumble….many organizations still relegate monitoring & observability as the purview of ops, infra and SRE teams. This is a mistake - achieving a highly observable system requires collaboration up and down the stack.
I, a former op, would like to extend an invitation to all application developers to join the observability party will share these foundational concepts to build on:
Pushing the limits of ePRTC: 100ns holdover for 100 daysAdtran
At WSTS 2024, Alon Stern explored the topic of parametric holdover and explained how recent research findings can be implemented in real-world PNT networks to achieve 100 nanoseconds of accuracy for up to 100 days.
The Metaverse and AI: how can decision-makers harness the Metaverse for their...Jen Stirrup
The Metaverse is popularized in science fiction, and now it is becoming closer to being a part of our daily lives through the use of social media and shopping companies. How can businesses survive in a world where Artificial Intelligence is becoming the present as well as the future of technology, and how does the Metaverse fit into business strategy when futurist ideas are developing into reality at accelerated rates? How do we do this when our data isn't up to scratch? How can we move towards success with our data so we are set up for the Metaverse when it arrives?
How can you help your company evolve, adapt, and succeed using Artificial Intelligence and the Metaverse to stay ahead of the competition? What are the potential issues, complications, and benefits that these technologies could bring to us and our organizations? In this session, Jen Stirrup will explain how to start thinking about these technologies as an organisation.
2. WHO IS RYAN MAUGER?
• Zend Framework Contributor
• Zend Framework CR Team Member
• Co-Author of Zend Framework 2 in Action (With Rob Allen)
• Technical Editor for Zend Framework: A Beginners Guide
• Community Supporter
• Zend Certified PHP5 Engineer
• Lead Developer at Lupimedia and trainer at Lupijuice
5. What is the ODM?
Object Document Mapper
Similar to an ORM
6. What is the ODM?
Object Document Mapper
Similar to an ORM
But works with a Document Database
7. What is the ODM?
Object Document Mapper
Similar to an ORM
But works with a Document Database
8. Whats the advantage?
• Schema-less design (no complicated ALTER
TABLE statements, just save your data!
• Works with JSON objects, familiar with what
your already doing
• Simple!
9. Whats the advantage?
• Schema-less design (no complicated ALTER
TABLE statements, just save your data!
• Works with JSON objects, familiar with what
your already doing
• Simple! (at least to get started)
10. Whats the advantage?
Doctrine 2
• Uses the Data Mapper pattern
• Simplifies your domain, removes the
persistence logic
• Entities are free to do their job
• Defines a framework by which your domain
model will work, improving consistency
11. Getting started with the
ODM
Persistence operations revolve around the Document Manager
Mapping of properties is carried out through annotations in
your entities, or through xml/yaml mappings
12. <?php
namespace ApplicationBlog;
/**
* @Document(db="blog", collection="posts")
*/
class Post
{
/**
* @Id
*/
private $id;
An example entity
/**
* @Field(type="string")
*/
private $title;
/**
* @String
*/
Properties
private $content;
/** /**
* @EmbedMany(targetDocument="ApplicationBlogComment")
*/ * @Id
private $comments = array();
*/
public function getId() private $id;
{
return $this->id;
} /**
public function setId($id) * @Field(type="string")
{
$this->id = (string) $id; */
return $this; private $title;
}
public function getTitle()
{
/**
return $this->title; * @String
}
*/
public function setTitle($title) private $content;
{
$this->title = (string) $title;
}
return $this; /**
* @EmbedMany(targetDocument="ApplicationBlogComment")
public function getContent()
{ */
return $this->content; private $comments = array();
}
public function setContent($content)
{
$this->content = (string) $content;
return $this;
}
public function getComments()
{
return $this->comments;
}
public function addComment(ApplicationBlogComment $comment)
{
$this->comments[] = $comment;
return $this;
}
}
13. <?php
namespace ApplicationBlog;
/**
* @Document(db="blog", collection="posts")
*/
class Post
{
/**
* @Id
*/
private $id;
An example entity
/**
* @Field(type="string")
*/
private $title;
/**
* @String
*/
Methods
private $content;
/**
* @EmbedMany(targetDocument="ApplicationBlogComment")
public function getContent()
*/ {
private $comments = array();
return $this->content;
public function getId() }
{
return $this->id;
} public function setContent($content)
public function setId($id) {
{
$this->id = (string) $id; $this->content = (string) $content;
return $this; return $this;
}
}
public function getTitle()
{
return $this->title; public function getComments()
}
{
public function setTitle($title) return $this->comments;
{
$this->title = (string) $title; }
return $this;
}
public function addComment(ApplicationBlogComment $comment)
public function getContent()
{ {
return $this->content; $this->comments[] = $comment;
}
return $this;
public function setContent($content)
{
}
$this->content = (string) $content;
return $this;
}
public function getComments()
{
return $this->comments;
}
public function addComment(ApplicationBlogComment $comment)
{
$this->comments[] = $comment;
return $this;
}
}
14. Using your entity
Create
<?php
class IndexController extends Zend_Controller_Action
{
public function init()
{
/* Initialize action controller here */
}
public function indexAction()
{
$documentManager = $this->getInvokeArg('bootstrap')->getResource('odm');
$post = new ApplicationBlogPost();
$post->setTitle('My Interesting Post')
->setContent('I have somethnng very interesting to say');
$documentManager->persist($post);
$documentManager->flush();
}
}
> use blog
switched to db blog
> db.posts.find();
{ "_id" : ObjectId("4dde4067fbd2237df1000000"), "title" : "My Interesting Post", "content" : "I have somethnng very
interesting to say" }
15. Using your entity
Update
<?php
class IndexController extends Zend_Controller_Action
{
public function init()
{
/* Initialize action controller here */
}
public function indexAction()
{
$documentManager = $this->getInvokeArg('bootstrap')->getResource('odm');
$post = $documentManager->getRepository('ApplicationBlogPost')
->find('4dde4067fbd2237df1000000');
$post->setTitle('My Interesting Post')
->setContent('I have something very interesting to say');
$documentManager->persist($post);
$documentManager->flush();
}
}
> db.posts.find();
{ "_id" : ObjectId("4dde4067fbd2237df1000000"), "title" : "My Interesting Post", "content" : "I have something very
interesting to say" }
16. Using your entity
Add an comment
<?php
class IndexController extends Zend_Controller_Action
{
public function init()
{
/* Initialize action controller here */
}
public function indexAction()
{
$documentManager = $this->getInvokeArg('bootstrap')->getResource('odm');
$post = $documentManager->getRepository('ApplicationBlogPost')
->find('4dde4067fbd2237df1000000');
$comment = new ApplicationBlogComment();
$comment->setEmail('foo@example.com')
->setComment('Nice post!');
$post->addComment($comment);
$documentManager->persist($post);
$documentManager->flush();
}
}
> db.posts.find();
{ "_id" : ObjectId("4dde4067fbd2237df1000000"), "comments" : [
{
"_id" : ObjectId("4dde439afbd22380f1000000"),
"email" : "foo@example.com",
"comment" : "Nice post!"
}
], "content" : "I have something very interesting to say", "title" : "My Interesting Post" }
17. Using your entity
Delete
<?php
class IndexController extends Zend_Controller_Action
{
public function init()
{
/* Initialize action controller here */
}
public function indexAction()
{
$documentManager = $this->getInvokeArg('bootstrap')->getResource('odm');
$post = $documentManager->getRepository('ApplicationBlogPost')
->find('4dde4067fbd2237df1000000');
$documentManager->remove($post);
$documentManager->flush();
}
}
> db.posts.find();
>
19. Available Annotations
http://www.doctrine-project.org/docs/mongodb_odm/1.0/en/
reference/annotations-reference.html
@Field(type="string" name="origin")
Field Mappings. Many aliases are available: @String, @Date, @Int, @Float etc.
@EmbedOne / @EmbedMany
Embedded Documents, stores the document inside the current document
@ReferenceOne / @ReferenceMany
Referenced Documents, stores a reference to one or more documents outside the current document
@Document / @EmbeddedDocument
Marks entities which are allowed to be managed by the document manager. additionally
EmbeddedDocuments may not be saved independently, and must be a child of an @Document
@HasLifecycleCallbacks & @PrePersist, @PostPersist etc.
Marks an entity as having callbacks such as PrePersist which will be called automatically by the
DocumentManager during the entities lifetime. (see reference for list)
30. Base Controller
• Provide an easy method to access the
DocumentManager, and perhaps a service
layer / repository
• Not using an action helper because we will be
likely to be using this tightly everywhere, so it
avoids writing _helper a few hundred times!
• You could use an action helper and use IOC or
similar to replace this, this is for simplicity
31. <?php
namespace LupiController;
Base Controller
abstract class Action extends Zend_Controller_Action
{
/**
* @var Zend_Application
*/ Override the constructor at this point!
protected $bootstrap;
/**
* @var DoctrineODMMongoDBDocumentManager
*/
protected $dm;
It’s useful to leave
public function __construct(Zend_Controller_Request_Abstract $request,
Zend_Controller_Response_Abstract $response,
array $invokeArgs = array())
init() for the final
{
$this->setRequest($request)
->setResponse($response)
implementation so
->_setInvokeArgs($invokeArgs);
$this->_helper = new Zend_Controller_Action_HelperBroker($this);
$this->dm = $this->getBootstrap()->getResource('odm');
you don’t need to
$this->init();
} remember to always
public function getBootstrap()
{
if (null === $this->bootstrap) {
call parent::init()
$this->bootstrap = $this->getInvokeArg('bootstrap');
}
return $this->bootstrap;
}
}
32. Simplified controller code
<?php
use LupiController as controller;
class IndexController extends controllerAction
{
Common repository for
/**
* @var DoctrineODMMongoDBDocumentRepository
*/
the controller, set it in
protected $repository;
public function init()
the init
{
$this->repository = $this->dm->getRepository('ApplicationBlogPost');
}
public function indexAction()
{
$post = $this->repository->find('4dde4067fbd2237df1000000');
$comment = new ApplicationBlogComment();
$comment->setEmail('foo@test.com')
->setComment('nice post!');
$post->addComment($comment);
$this->dm->persist($post);
$this->dm->flush();
}
}
33. Simplified controller code
<?php
use LupiController as controller;
class IndexController extends controllerAction
{
Common repository for
/**
* @var DoctrineODMMongoDBDocumentRepository
*/
the controller, set it in
protected $repository;
public function init()
the init
{
$this->repository = $this->dm->getRepository('ApplicationBlogPost');
}
public function indexAction()
{
$post = $this->repository->find('4dde4067fbd2237df1000000');
$comment = new ApplicationBlogComment();
$comment->setEmail('foo@test.com')
->setComment('nice post!');
$post->addComment($comment);
$this->dm->persist($post);
$this->dm->flush();
}
}
Nice verbose code!
37. Managing change
• The db is schema-less
• You can add properties, without needing to
update the old objects until your ready
38. Managing change
• The db is schema-less
• You can add properties, without needing to
update the old objects until your ready
• Simply add the property, and update old
objects through your usual admin interface
39. Managing change
• The db is schema-less
• You can add properties, without needing to
update the old objects until your ready
• Simply add the property, and update old
objects through your usual admin interface
• Objects without the new property will simply
have a null value until you change them
44. Transforming a property
From <?php
To
namespace ApplicationBlog;
/**
* @Document(db="blog", collection="posts")
<?php */
namespace ApplicationBlog; class User
{
/** /**
* @Id
* @Document(db="blog", collection="posts") */
*/ private $id;
class User
{ /**
* @Field(type="string")
/** */
* @Id private $firstname;
*/
private $id; /**
* @Field(type="string")
*/
/** private $lastname;
* @Field(type="string")
*/ /**
* @ReferenceMany(targetDocument=”ApplicationBlogPost”)
private $fulllname; */
private $posts;
/**
* @ReferenceMany(targetDocument=”ApplicationBlogPost”) /**
* @AlsoLoad({“fullname”})
*/ */
private $posts; public function populateNameProperties($fullname)
} {
$name = explode(‘ ‘, $fullname);
$this->firstname = $name[0];
$this->lastname = $name[1];
Use a method to migrate using }
}
@AlsoLoad
45. NOTE!
• When searching, your queries will not know
about the old name!
• Include old and new fields in your searches if
possible until all data has been migrated
46. NOTE!
• The ODM is still in BETA3, there are still
some glitches, but its well worth having a good
look now.
• http://www.doctrine-project.org/ and follow
progress
47. Useful information
• Official docs: http://www.doctrine-project.org/
docs/mongodb_odm/1.0/en/
• Mongodb: http://www.mongodb.org/ excellent
intro to mongodb
• The example sandbox: http://github.com/
bittarman/zf-d2-odm
48. Thanks for listening
Catch me on twitter: @Bittarman
Slides will be available on slideshare
http://slideshare.com/rmauger
ZF & Doctrine 2 ODM
Doctrine