<?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>Wed, 19 Jun 2013 08:03:27 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Jani Hartikainen's Blog: How to create Doctrine 1-style Soft-Delete in Doctrine 2]]></title>
      <guid>http://www.phpdeveloper.org/news/15539</guid>
      <link>http://www.phpdeveloper.org/news/15539</link>
      <description><![CDATA[<p>
<i>Jani Hartikainen</i> has <a href="http://codeutopia.net/blog/2010/12/04/how-to-create-doctrine-1-style-soft-delete-in-doctrine-2/">posted his technique</a> for making the Doctrine version 1 style "soft delete" in your Doctrine 2 powered application.
</p>
<blockquote>
Doctrine 1 has the concept of behaviors which you could add to your models. One of these was the soft-delete behavior, which allowed you to "delete" records without really deleting them. Doctrine 2 <a href="http://www.doctrine-project.org/blog/doctrine2-behaviours-nutshell">does not have behaviors due to various reasons</a>. However, I needed a way to have a model which worked like soft-delete. Let's see one approach to creating such behavior in Doctrine 2.
</blockquote>
<p>
He introduces the idea of a "soft delete" - essentially a flag that gets set to let the rest of the application think that row is essentially deleted. He shows you how to create the similar functionality via a repository that filters the data for you. He includes code to help you along, defining the find/findOneBy/findBy and the example repository that lets you set an "is deleted" property on the object.
</p>]]></description>
      <pubDate>Mon, 06 Dec 2010 13:02:08 -0600</pubDate>
    </item>
  </channel>
</rss>
