<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Tue, 18 Jun 2013 18:07:20 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Ibuildings techPortal: DPCRadio: Embracing Constraints with CouchDB]]></title>
      <guid>http://www.phpdeveloper.org/news/16089</guid>
      <link>http://www.phpdeveloper.org/news/16089</link>
      <description><![CDATA[<p>
On the Ibuildings techPortal today they've posted the latest webcast in their "DPCRadio" series as recorded at last year's <a href="http://phpconference.nl">Dutch PHP Conference</a>. In this latest episode they share <i>David Zuelke</i>'s talk <a href="http://techportal.ibuildings.com/2011/03/23/dpcradio-embracing-constraints-with-couchdb/">Embracing Constraints with CouchDB</a>.
</p>
<blockquote>
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.
</blockquote>
<p>
You can either listen <a href="http://techportal.ibuildings.com/2011/03/23/dpcradio-embracing-constraints-with-couchdb/">in-page</a> or <a href="http://dpcradio.s3.amazonaws.com/2010_016.mp3">download the mp3</a> to get this latest episode. If you'd like to follow along with his slides, you can find them <a href="http://www.slideshare.net/Wombert/embracing-constraints-with-couchdb">on SlideShare</a>.
</p>]]></description>
      <pubDate>Wed, 23 Mar 2011 12:12:25 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[ServerGrove Blog: Enforcing unique key constrains with Doctrine ODM for MongoDB & Symfony 2]]></title>
      <guid>http://www.phpdeveloper.org/news/15315</guid>
      <link>http://www.phpdeveloper.org/news/15315</link>
      <description><![CDATA[<p>
New on the ServerGrove blog today is <a href="http://blog.servergrove.com/2010/10/20/enforcing-unique-key-constrains-with-doctrine-odm-for-mongodb-symfony-2/">a quick post</a> talking about how you can enforce key constraints on a MongoDb with Doctrine in Symfony.
</p>
<blockquote>
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 <a href="http://www.doctrine-project.org/projects/mongodb_odm/1.0/docs/reference/indexes/en#unique-index">official documentation</a>. 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.
</blockquote>
<p>
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.
</p>]]></description>
      <pubDate>Thu, 21 Oct 2010 11:58:22 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Sebastian Bergmann's Blog: Hamcrest]]></title>
      <guid>http://www.phpdeveloper.org/news/9337</guid>
      <link>http://www.phpdeveloper.org/news/9337</link>
      <description><![CDATA[<p>
In a <a href="http://sebastian-bergmann.de/archives/733-Hamcrest.html">new post</a> to his blog, <i>Sebastian Bergmann</i> mentions a new effort he's undertaken - the porting of the <a href="http://code.google.com/p/hamcrest/">Hamcrest</a> library of matcher objects to PHP.
</p>
<blockquote>
I have begun to port <a href="http://code.google.com/p/hamcrest/">Hamcrest</a>, 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.
</blockquote>
<p>
The <a href="http://fisheye3.cenqua.com/browse/hamcrest/trunk/hamcrest-php">hamcrest-php project</a> compliments other current hamcrest-related projects and his ultimate goal is to make it available to the <a href="http://www.phpunit.de">PHPUnit</a> testing community (as well as with the <a href="http://code.google.com/p/phpmock/">PHPMock</a> effort).
</p>]]></description>
      <pubDate>Tue, 01 Jan 2008 14:16:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Ivo Jansch's Blog: Validating OCL constraints in PHP objects]]></title>
      <guid>http://www.phpdeveloper.org/news/9049</guid>
      <link>http://www.phpdeveloper.org/news/9049</link>
      <description><![CDATA[<p>
While attending a code camp for <a href="http://www.xenerix.org/">Xenerix</a>, <i>Ivo Jansch</i> decided to <a href="http://www.jansch.nl/2007/11/15/validating-ocl-constraints-in-php-objects/">challenge himself</a> to create a way to implement <a href="http://en.wikipedia.org/wiki/Object_Constraint_Language">Object Constraint Language</a> functionality in PHP objects.
</p>
<blockquote>
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.
</blockquote>
<p>
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 <a href="http://www.jansch.nl/wp-content/uploads/2007/11/classoclwrapperphp.txt">OCL wrapper class</a> to handle most of the hard work, but he provides the code examples you'll need to see it in action, complete with constraints.
</p>]]></description>
      <pubDate>Thu, 15 Nov 2007 08:44:00 -0600</pubDate>
    </item>
  </channel>
</rss>
