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

Ibuildings techPortal:
DPCRadio Embracing Constraints with CouchDB
March 23, 2011 @ 12:12:25

On the Ibuildings techPortal today they've posted the latest webcast in their "DPCRadio" series as recorded at last year's Dutch PHP Conference. In this latest episode they share David Zuelke's talk Embracing Constraints with CouchDB.

There has been a lot of buzz lately about the NoSQL movement in general and CouchDB in particular. For people who are used to relational databases, a lot of CouchDB's limitations look like severe disadvantages; these constraints however can also be great opportunities. This talk will give an overview of CouchDB and then focus on embracing the system's constraints to build better products.

You can either listen in-page or download the mp3 to get this latest episode. If you'd like to follow along with his slides, you can find them on SlideShare.

0 comments voice your opinion now!
constraint couchdb dpcradio dpc10 session


ServerGrove Blog:
Enforcing unique key constrains with Doctrine ODM for MongoDB & Symfony 2
October 21, 2010 @ 11:58:22

New on the ServerGrove blog today is a quick post talking about how you can enforce key constraints on a MongoDb with Doctrine in Symfony.

Of course you can define unique indexes to prevent duplicate values and there are a couple of different syntax options to do so, which are clearly defined in the official documentation. But defining and creating the indexes is not enough. You must specify when you want to enforce the constrain, this is due to the fact that the PHP driver needs to tell MongoDB to throw an error when a duplicate key is found.

The fix is as simple as adding a "safe" option to the "flush()" call on your database object. If you give it a value of "true", the ORM is smart enough to handle things on its own.

0 comments voice your opinion now!
mongodb enforce symfony constraint unique doctrine


Sebastian Bergmann's Blog:
Hamcrest
January 01, 2008 @ 14:16:00

In a new post to his blog, Sebastian Bergmann mentions a new effort he's undertaken - the porting of the Hamcrest library of matcher objects to PHP.

I have begun to port Hamcrest, which provides a library of matcher objects (also known as constraints or predicates) allowing "match" rules to be defined declaratively, to be used in other frameworks. Typical scenarios include testing frameworks, mocking libraries and UI validation rules, to PHP.

The hamcrest-php project compliments other current hamcrest-related projects and his ultimate goal is to make it available to the PHPUnit testing community (as well as with the PHPMock effort).

0 comments voice your opinion now!
hamcrest phpunit matcher constraint object phpmock port hamcrest phpunit matcher constraint object phpmock port


Ivo Jansch's Blog:
Validating OCL constraints in PHP objects
November 15, 2007 @ 08:44:00

While attending a code camp for Xenerix, Ivo Jansch decided to challenge himself to create a way to implement Object Constraint Language functionality in PHP objects.

To give a practical example: if you have a class 'Creditcard', you could define the constraints 'self.limit > 0' when withdrawing an amount. While the goal of the code camp was to do some nifty things with OCL and Ruby, I wanted to see if I could create a method to easily implement OCL constraints in arbitrary PHP objects.

He structures his example similar to the one provided, making CreditCard and Person classes with constraints on the person's name, withdrawing past the expire date of the card and the keeping the limit of the card above zero. He created a OCL wrapper class to handle most of the hard work, but he provides the code examples you'll need to see it in action, complete with constraints.

0 comments voice your opinion now!
ocl constraint object language tutorial class wrapper ocl constraint object language tutorial class wrapper



Community Events





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


install introduction configure refactor podcast code series language interview laravel release unittest opinion framework list developer symfony2 threedevsandamaybe community testing

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