News Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Doctrine Project:
Our HHVM Roadmap
December 24, 2013 @ 11:57:58

The Doctrine project has posted an update about the work being done in collaboration with and to help its performance with HHVM (the HipHop VM from Facebook) and talking about their future plans.

Facebook has been pushing HHVM alot lately, helping open source projects to get their test-suite running 100%. For Doctrine HHVM is particularly interesting, because of the performance gains that the complex PHP algorithms inside ORM would probably get. From my current feeling Doctrine will be the PHP open-source project getting the most gain from running on HHVM. However with the tests not yet passing on the ORM, we can only imagine how big that performance improvement will be.

One of their goals is to be able to run DBAL/ORM on HHVM with 100% passing tests. So far they've been working on Common project functionality and have three as fully supported under HHVM - Collections, Inflector and Lexer. Work is still being done on other parts of the codebase, with the ORM and DBAL being the lion's share of the job.

0 comments voice your opinion now!
doctrine project hhvm facebook orm dbal common

Link: http://www.doctrine-project.org/blog/our-hhvm-roadmap.html

Kristopher Wilson:
Decoupling the Framework
December 02, 2013 @ 12:19:36

Kristopher Wilson has a new post to his site talking about something that could be very difficult with an existing application (and a good starting place for a new one) - decoupling from the framework. He advocates that your application shouldn't be an extension of the framework, more so a user of it to make it potentially easy to replace.

We spend a lot of time discussing and analyzing the features and merits of several frameworks, trying very hard to make sure we find the perfect one to use for our project. Rightfully so: picking the wrong framework can lead to a slew of issues down the road in terms of maintenance and scalability. [...] We also spent a considerable amount of effort making sure that there is minimal amount of coupling within our code. Strong coupling leads to problems testing, adapting, refactoring and reusing code. What if we applied that same principal to dealing with whatever framework we're using?

He goes on to look at the "framework is not your application" concept and fleshes it out with examples of it applied to a few different topics: Controllers, Models and ORMs. He also shows how, through the use of something like Doctrine's EntityManager, you can easily abstract things out so the internals of the application can easily split the application and framework.

0 comments voice your opinion now!
decouple framework controller model orm doctrine entity

Link: http://kristopherwilson.com/2013/11/27/decoupling-the-framework/

Developer Drive:
Introducing Laravel, part 2
October 28, 2013 @ 13:18:51

The Developer Drive blog has posted the second part of their series introducing the Laravel PHP framework. In this new tutorial they build on the basics from part one to briefly discuss controllers and the Eloquent ORM.

In the first part of this introductory mini series we looked at simple routes and views and now we'll look at how to work with controllers and models , how these two fit in the framework and how to use them.

They explain some of the basics of controllers first including a bit of sample code showing how to output a basic view and add a new route. Following that is a brief look at using the ORM and making a model - a Post - and defining the table it relates to.

0 comments voice your opinion now!
laravel framework introduction series part2 controller route model eloquent orm

Link: http://www.developerdrive.com/2013/10/introducing-laravel-part-2/

David Adams:
Is ORM abstraction a pipe dream?
October 23, 2013 @ 09:59:21

David Adams has published a recent post that wonders if ORM abstraction is a "pipe dream" when it comes to abstraction. ORM stands for "object relational mapper" and is commonly used as a layer between the application and a dta source to work with the data as objects, not directly with it. He instead investigates replacing the ORM layer with multiple instances of repository pattern-structured code to abstract thing even more.

I was recently introduced to the repository pattern, a type of abstraction and organizational technique. The idea being, create a repository for each of your models to retrieve and persist to and from. A supposed benefit of the repository pattern is the ability to abstract your ORM and create different implementations for Eloquent, Doctrine, Propel, etc. This abstraction intrigued me. I set off to put this idea into practice and see what it took. Here are my findings.

He looks into how Doctrine handles its entities and tries to mimic some of the logic, including the calls to "save" and "flush". He also looks at how to handle a few other common ORM-ish topics like relationships, validation and observers. Unfortunately, he hit a wall with his solution and wasn't able to figure out a good Repository-based solution.

0 comments voice your opinion now!
repository designpattern proofofconcept orm object mapper doctrine entity

Link: http://programmingarehard.com/2013/10/21/is-orm-abstraction-a-pipe-dream.html

SitePoint PHP Blog:
Introduction to Redbean
October 08, 2013 @ 12:54:31

On the SitePoint PHP blog there's a new post introducing you to Redbean, a n ORM that can help you quickly prototype out applications that has a few tricks up its sleeve.

When it comes to RAD and prototyping, there are lots of tools available to help get projects up-and-running quickly. From quick-starts to micro-frameworks, from build tools such as Composer to one-click installers, and of course ORMs - there are all sorts of ways to speed up development time. I'm going to look at Redbean, an ORM with a difference, which is ideal for prototyping. Redbean is an ORM (Object Relational Mapper), but it does more than that - it creates and modifies the underlying schema on-the-fly.

He walks you through the installation of the library (well, links to this page on their site) and shows you how to "dispense" your first "bean" object. There's also some examples of saving objects, creating new ones and searching using the "load" method. Any good ORM also includes the ability to define relations, and Readbean is no exception - examples of this are also included. There's also a quick bit at the end about making models and querying the database directly with a SQL string.

0 comments voice your opinion now!
introduction readbean orm library tutorial

Link: http://www.sitepoint.com/introduction-redbean/

Simon Holywell:
Idiorm and Paris 1.3.0 released - the minimalist ORM and fluent query builder for PH
February 27, 2013 @ 10:33:33

Simon Holywell has a new post to his site about a project that aims to be a minimalist ORM library and make it easier to built queries on the fly for your applications (and is installable via Composer) - the Idorm + Paris combination.

Idiorm is a PHP ORM that eschews complexity and deliberately remains lightweight with support for PHP5.2+. [...] However, having said this, Idiorm is very powerful and it makes most of the queries PHP applications require pain free. Some of these features include fluent query building, multiple connection support and result sets for easy record manipulation. Paris sits on top of Idiorm to provide a simplified active record implementation based upon the same minimalist philosophy.

He includes examples in the post of both queries with Idiorm - simple things like creating and finding records - and using Paris to make models out of PHP objects. He also talks some about the current state of the project, recent advancements and some of the things they're looking to do with it in the future (including dropping PHP 5.2 support and use late static binding).

0 comments voice your opinion now!
library project orm idiorm paris activerecord simplicity


Andrew Podner:
Lithium Getting Stuff From Your Database
January 14, 2013 @ 10:36:31

Andrew Podner has a new post for those wanting to find out more about the Lithium framework and using models to work with your database.

Today I want to provide a tutorial on how to do some basic interaction with a database in Lithium, and I am going to rely on MySQL as a database for the purposes of this tutorial, although you have other options like MongoDB, as an example.

His example script uses the idea of "blog posts" stored in a MySQL table and code snippets are included showing how to:

  • Create the model class based off of the core Lithium one
  • Select all of the records from the table
  • Filter down the returned values with "magic finder" methods (like "findAllByStatus")

You can find out more about the framework in the project's documentation section of their site.

0 comments voice your opinion now!
database orm model find tutorial mysql


Michael Nitschinger:
Caching Doctrine Entities with Couchbase
January 08, 2013 @ 10:19:07

Michael Nitschinger has a new post to his site today showing how you can cache the entities you've created with Doctrine using Couchbase as a simple caching tool.

As part of our ongoing efforts to make Couchbase more integrated with frameworks and libraries, we added caching support for the Doctrine ORM. [...] Caching can either be used standalone (through the API provided by doctrine/common) or integrated with the ORM functionality. We'll look at both variants through simple examples, a good documentation can also be found here. Note that at the time of writing, the CouchbaseCache is not mentioned as a caching driver because the documentation still needs to be updated.

He walks you through the steps to get everything you need installed, both through Composer and the Couchbase extension so your PHP installation will support it. He includes sample code that sets up the cache and shows how to check it to see if a key exists. With this base in place, he expands it out to working with the Doctrine ORM. He shows how to create a sample "Person" entity, inject it into the entity manager and perform a query with the Result Cache to locate the object.

0 comments voice your opinion now!
doctrine entity cache orm couchbase tutorial


PHPMaster.com:
Database Interaction Made Easy with NotORM
July 19, 2012 @ 08:42:13

On PHPMaster.com today there's a new tutorial showing you how to use the NotORM tool to work with your database:

Object Relational Mappers (ORMs) are cool. They help you to rapidly create your application without worrying about writing raw SQL queries. The idea is to simplify database interaction and avoid possible errors in writing complex queries. In fact, modern ORMs can generate Models/Entities from the database, and vise versa. But the reality of working with any ORM is that using it is only simple if you already have experience using it. To make the most out of it, you should have a deep understanding of the concepts. And there's a steep learning curve associated with any ORM.

They introduce you to the NotORM tool and guide you through some of the initial steps to help make this curve a little less steep. Their sample database contains book information (author, category, book detail, etc) with PDO making the connection (injected into the NotORM instance). They show how to do things like simple selects, filtering with "where", sort the results, doing joins and doing inserts.

0 comments voice your opinion now!
database orm notorm library tutorial


NetTuts.com:
Build Web Apps from Scratch with Laravel - The Eloquent ORM
June 28, 2012 @ 12:27:14

In the second part of their series looking at the Laravel PHP framework and creating your first application with it. In part one you got a brief introduction to creating and configuring an application. In part two they dig a little deeper and talk about Laravel's ORM functionality.

In this Nettuts+ mini-series, we'll build a web application from scratch, while diving into a great new PHP framework that's rapidly picking up steam, called Laravel. In this lesson, we'll be working on an integral part of any web application: the Models. Along the way, we'll learn about Laravel's amazing ORM implementation: Eloquent.

The tutorial introduces you to the concept of "Models" and some of the conventions that surround them in the Laravel framework. They show some of the most common operations (CRUD) and how to define relationships between the models (has many, has one, etc). They apply this to their "Instapics" example application, creating the interfaces for the users, profiles, relationships, photos and comments. They include the code to create the controllers/views to go along with them, making a simple interface to show users and their photos.

You can find out more about the Eloquent ORM in this section of the Laravel manual.

0 comments voice your opinion now!
laravel tutorial eloquent orm instapics user profile photo model



Community Events





Don't see your event here?
Let us know!


interview list development code introduction zendserver symfony podcast conference deployment developer threedevsandamaybe language release framework series api laravel tips community

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework