<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>
<channel>
	<title>levelx.me &#187; Programming</title>
	<atom:link href="http://levelx.me/category/technology/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://levelx.me</link>
	<description></description>
	<lastBuildDate>Wed, 11 Jan 2012 13:46:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>WordPress vs Joomla Vs Drupal &#8211; Infographic Comparison</title>
		<link>http://levelx.me/technology/wordpress-vs-joomla-vs-drupal-infographic-comparison/</link>
		<comments>http://levelx.me/technology/wordpress-vs-joomla-vs-drupal-infographic-comparison/#comments</comments>
		<pubDate>Tue, 26 Jul 2011 16:39:24 +0000</pubDate>
		<dc:creator>AF8AB</dc:creator>
				<category><![CDATA[Infographics]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Wordpress Joomla Drupal Comparison]]></category>
		<category><![CDATA[Wordpress Statistics.]]></category>
		<category><![CDATA[Wordpress vs Joomla Comparison]]></category>
		<guid isPermaLink="false">http://levelx.me/technology/wordpress-vs-joomla-vs-drupal-infographic-comparison/</guid>
		<description><![CDATA[Who is the real king of Open Source CMS platforms? Each WordPress, Drupal and Joomla have their own advantages and discrepancies, for example WordPress has hundreds of amazing premium and free themes and plugins available and is very easy to use. Joomla is a very powerful CMS as compared to WordPress which is basically a [...]]]></description>
			<content:encoded><![CDATA[<p>Who is the real king of Open Source CMS platforms? Each WordPress, Drupal and Joomla have their own advantages and discrepancies, for example WordPress has hundreds of amazing premium and free themes and plugins available and is very easy to use. Joomla is a very powerful CMS as compared to WordPress which is basically a blogging platform.</p>
<p><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px 10px 5px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="cms-compare-header" border="0" alt="cms-compare-header" src="http://levelx.me/blog/wp-content/uploads/2011/07/cms-compare-header.png" width="620" height="253" /></p>
<p>Devious Media have created this interested info-graphic with comprehensive details about each of the platforms. Let&#8217;s&#8217; have a look.</p>
<p>Click Image for a Larger Version</p>
<p><span id="more-4092"></span>
<p><a href="http://levelx.me/blog/wp-content/uploads/2011/07/cms-comparison.png" target="_blank" rel="lightbox[4092]"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px 10px 5px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="cms-comparison" border="0" alt="cms-comparison" src="http://levelx.me/blog/wp-content/uploads/2011/07/cms-comparison_thumb.png" width="620" height="2439" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://levelx.me/technology/wordpress-vs-joomla-vs-drupal-infographic-comparison/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Symfony 1.4 &#8211; Doctrine and Multiple Database Connections</title>
		<link>http://levelx.me/technology/programming/symfony-1-4-doctrine-and-multiple-database-connections/</link>
		<comments>http://levelx.me/technology/programming/symfony-1-4-doctrine-and-multiple-database-connections/#comments</comments>
		<pubDate>Mon, 13 Jun 2011 21:56:14 +0000</pubDate>
		<dc:creator>Faizan</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[doctrine]]></category>
		<category><![CDATA[doctrine 1.2]]></category>
		<category><![CDATA[laoad balancing]]></category>
		<category><![CDATA[multiple databases]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[symfony 1.4]]></category>
		<category><![CDATA[symfony 2]]></category>
		<category><![CDATA[symfony doctrine multiple databases.symfony doctrine multiple connections]]></category>
		<category><![CDATA[yml]]></category>
		<guid isPermaLink="false">http://levelx.me/technology/programming/symfony-1-4-doctrine-and-multiple-database-connections/</guid>
		<description><![CDATA[Symfony is one of the best PHP framework out there and provides great control over your code.&#160; It provides speed, security, ease of use and flexibility out of the box. But some times due to lack of documentation or outdated information on internet you get stuck in different issues for which even googling can’t help [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://symfony.com" target="_blank">Symfony</a> is one of the best PHP framework out there and provides great control over your code.&#160; It provides speed, security, ease of use and flexibility out of the box. But some times due to lack of documentation or outdated information on internet you get stuck in different issues for which even googling can’t help so you have to figure it out yourself.&#160; While working on a project I got stuck in an issue with multiple databases and Doctrine ORM. Suppose you are creating a web application where for each user of application there is a separate database stored on some different server, we call this <em>Client</em> database, while there is one <em>Master</em> database which stores user’s credentials and their <em>Client</em> database credentials. Now when user logs in we have to modify DSN (Data Source name) for <em>client</em> database depending on which user has logged in.</p>
<p><span id="more-3975"></span>
<p>for setting up multiple databases I got help from <a href="http://goo.gl/HmVin" target="_blank">symfony’s 1.2 documentation</a> so I’m using same code that is used there.</p>
<p>in config/databases.yml file you’ve to define both master and client database dsn and credentials</p>
<pre><code>all:
  master:
    class: sfDoctrineDatabase
    param:
      dsn: 'mysql:host=localhost;dbname=master'
      username: user
      password: secret
  client:
    class: sfDoctrineDatabase
    param:
      dsn: 'mysql:host=localhost;dbname=client'
      username: user
      password: secret</code></pre>
<p>and your schema.yml file looks like this, see connection parameter Client Model uses master database connection and Store Model uses client database connection.</p>
<pre><code>Client:
  connection: master
  columns:
    name: string(255)
    username: string(255)
    password: string(255)</code></pre>
<pre><code>ClientDatabase:
  connection: master
  columns:
    id:
      type: integer
      primary: true
      autoincrement: true
    hostname:
      type: string(255)
    username:
      type: string(45)
    password:
      type: string(45)
    database_name:
      type: string(45)
    client_id:
      type: integer
      notnull: true</code></pre>
<pre><code>Store:
  connection: client
  attributes:
    export: tables
  columns:
    name: string(255)
    description: string(500)
    client_id: integer
  relations:
    Client:
     foreignAlias: Stores</code></pre>
<p>you’ve to rebuilt your models and database after defining these multiple databases.</p>
<p>Considering above schema as our example if a client logs in to our system it will use default client dsn connection but we have to load their Store info from their client DSN and that maybe on some other server defined in <code>CustomerDatabase</code> Table.</p>
<p>The best way to do is to create a filter for your app, define it in frontend/config/filters.yml file after rendering filter</p>
<pre><code>rendering: ~
client_db_connection:
  class: ClientDbSelectFilter</code></pre>
<p>now create a ClientDbSelectFilter.php file in frontend/lib directory and code will look like this. </p>
<pre><code>
&lt;?php
class ClientDbSelectFilter extends sfFilter
{
  public function execute($filterChain)
  {
    if($is_authenticated)
    {
      $client = Client::getClient(); //get current loggedin client
      if($client)
      {
        $database = $client-&gt;get<code>ClientDatabase</code>();
        $dbUser = $database-&gt;getUsername();
        $dbpass = $database-&gt;getPassword();
        $dbName = $database-&gt;getDatabaseName();
        $dbHost = $database-&gt;getHostname();
        if($dbUser != '' &amp;&amp; $dbHost != '' &amp;&amp; $dbHost != '')
        {
          $dbUser = $database-&gt;getUsername();
          $dbPass = $database-&gt;getPassword();
          $dbName = $database-&gt;getDatabaseName();
          $dbHost = $database-&gt;getHostname();
          $dsn = &quot;mysql:host=$dbHost;dbname=$dbName&quot;;
          $doctrineManager = Doctrine_Manager::getInstance();
          $doctrineManager-&gt;getConnection('client')
                          -&gt;setOption('dsn', $dsn);
          $doctrineManager-&gt;getConnection('client')
                          -&gt;setOption('username', $dbUser);
          $doctrineManager-&gt;getConnection('client')
                          -&gt;setOption('password', $dbPass);
        }
      }
    }
    $filterChain-&gt;execute();
  }
}</code></pre>
<p>above code will not work as it is, obviously you’ve to modify it according to your application. The code that actually changes DSN for client database is as follows.</p>
<pre><code>$dsn = &quot;mysql:host=$dbHost;dbname=$dbName&quot;;
$doctrineManager = Doctrine_Manager::getInstance();
$doctrineManager-&gt;getConnection('client')-&gt;setOption('dsn', $dsn);
$doctrineManager-&gt;getConnection('client')-&gt;setOption('username', $dbUser);
$doctrineManager-&gt;getConnection('client')-&gt;setOption('password', $dbPass);
        </code></pre>
<p>Let me know what do you think or if&#160; it worked out for you or not in comments.</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://levelx.me/technology/programming/symfony-1-4-doctrine-and-multiple-database-connections/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Basic Guide: How to Install WordPress on Localhost</title>
		<link>http://levelx.me/technology/basic-guide-to-install-wordpress-on-localhost/</link>
		<comments>http://levelx.me/technology/basic-guide-to-install-wordpress-on-localhost/#comments</comments>
		<pubDate>Tue, 15 Mar 2011 13:15:54 +0000</pubDate>
		<dc:creator>AF8AB</dc:creator>
				<category><![CDATA[Do it Yourself]]></category>
		<category><![CDATA[ETC]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Resources]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[how to wordpress]]></category>
		<category><![CDATA[how to wp]]></category>
		<category><![CDATA[installing wordpress]]></category>
		<category><![CDATA[setup wordpress]]></category>
		<category><![CDATA[wordpress install]]></category>
		<category><![CDATA[wordpress localhost]]></category>
		<guid isPermaLink="false">http://levelx.me/technology/basic-guide-to-install-wordpress-on-localhost/</guid>
		<description><![CDATA[This is a very basic guide to set up WordPress on your localhost. I develop custom WordPress blogs / websites and sometimes I have to test themes. For that I need WordPress on my localhost so I don’t have to run ftp softwares like File’fuggin’Zilla and move files around all the time on web server. [...]]]></description>
			<content:encoded><![CDATA[<p>This is a very basic guide to set up WordPress on your localhost. I develop custom WordPress blogs / websites and sometimes I have to test themes. For that I need WordPress on my localhost so I don’t have to run ftp softwares like File’fuggin’Zilla and move files around all the time on web server. Anyway, here is what you need to do.</p>
<p>I’m assuming you have Wampserver and mySql database running on your computer. If you don’t, you can go ahead and download Wamp setup from <a href="http://www.wampserver.com/en/download.php" target="_blank">here</a>. Installation is easy, ask your grandma to install it for you. Run it after its installed. Now,</p>
<p>Step 1 – Get latest version of WordPress from <a href="http://wordpress.org/download/" target="_blank">here</a>.</p>
<p>Step 2 – Extract the contents of downloaded Zip in your C:\wamp\www</p>
<p>Step 3 – Rename the folder <em>wordpress</em> to whatever you want i-e <em>NewBlog</em></p>
<p><span id="more-3661"></span>
<p>Step 4 – Click the WAMPSERVER icon in system tray and click phpMyAdmin. Now look for <strong><u>MySQL localhost</u></strong> Section, Enter the name of your new database, It can be anything but remember it as you’re going to need it later on. Click <strong>Create</strong> and close the window.</p>
<p>Step 5 – Now open <strong>localhost</strong> in your browser. <a title="http://localhost/" href="http://localhost/">http://localhost/</a></p>
<p>Step 6 – Look for <strong>Your Projects</strong> section, you’ll find names of folders that are located in your c:/wamp/www/.. directory. Click the link of your new site ( same as the folder you renamed earlier i-e <em>NewBlog</em> )</p>
<p>Step 7 – You will see this message in your browser. Click ‘Create a Configuration File’ button.</p>
<p><a href="http://levelx.me/blog/wp-content/uploads/2011/03/Step1.png" rel="lightbox[3661]"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px 10px 5px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Step1" border="0" alt="Step1" src="http://levelx.me/blog/wp-content/uploads/2011/03/Step1_thumb.png" width="620" height="158" /></a></p>
<p>Step 8 – Click ‘Lets go!’ on the next page. <a href="http://levelx.me/blog/wp-content/uploads/2011/03/Step2.png" rel="lightbox[3661]"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px 10px 5px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Step2" border="0" alt="Step2" src="http://levelx.me/blog/wp-content/uploads/2011/03/Step2_thumb.png" width="620" height="385" /></a></p>
<p>Enter the same database name you created in phpMysql. Enter <strong>root</strong> for username and leave the password <strong>blank</strong>. Keep database host and table prefix as it is. Click Submit.</p>
<p><a href="http://levelx.me/blog/wp-content/uploads/2011/03/Step3.png" rel="lightbox[3661]"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px 10px 5px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Step3" border="0" alt="Step3" src="http://levelx.me/blog/wp-content/uploads/2011/03/Step3_thumb.png" width="620" height="421" /></a></p>
<p><a href="http://levelx.me/blog/wp-content/uploads/2011/03/Step4.png" rel="lightbox[3661]"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px 10px 5px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Step4" border="0" alt="Step4" src="http://levelx.me/blog/wp-content/uploads/2011/03/Step4_thumb.png" width="620" height="183" /></a></p>
<p>Congrats, your WordPress is ready to install. Next steps are as easy as touching yourself.</p>
<p>It will ask you to enter site name and password for the admin account. Follow the steps and once its done it will take you to your shiny <strong>Dashboard</strong> or to <strong>login screen</strong>. Easy cheesy, no rocket science; no dolphin pregnancy complications.</p>
<p>Have fun with <strong>WordPress</strong>.</p>
<p>&#160;</p>
<p>-AFI</p>
]]></content:encoded>
			<wfw:commentRss>http://levelx.me/technology/basic-guide-to-install-wordpress-on-localhost/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What is google webP image format</title>
		<link>http://levelx.me/technology/what-is-google-webp-image-format/</link>
		<comments>http://levelx.me/technology/what-is-google-webp-image-format/#comments</comments>
		<pubDate>Sun, 03 Oct 2010 14:31:02 +0000</pubDate>
		<dc:creator>AF8AB</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[google webp]]></category>
		<category><![CDATA[jpeg will die]]></category>
		<category><![CDATA[web photo]]></category>
		<category><![CDATA[webp]]></category>
		<category><![CDATA[webp format]]></category>
		<category><![CDATA[webp vs jpeg]]></category>
		<guid isPermaLink="false">http://levelx.me/technology/what-is-google-webp-image-format/</guid>
		<description><![CDATA[Google has announced its exciting and new image format for the web called weppy or WebP. Google wants to improve the web in addition to saving the bandwidth of massive amounts of data flowing through Google’s servers. Here is what Google had to say about WebP and why a new image format was needed. Most [...]]]></description>
			<content:encoded><![CDATA[<p>Google has announced its exciting and new image format for the web called weppy or WebP. Google wants to improve the web in addition to saving the bandwidth of massive amounts of data flowing through Google’s servers. Here is what Google had to say about WebP and why a new image format was needed.</p>
<blockquote><p>Most of the common image formats on the web today were established over a decade ago and are based on technology from around that time. Some engineers at Google decided to figure out if there was a way to further compress lossy images like JPEG to make them load faster, while still preserving quality and resolution. As part of this effort, we are releasing a developer preview of a new image format, <a href="http://code.google.com/speed/webp/">WebP</a>, that promises to significantly reduce the byte size of photos on the web, allowing web sites to load faster than before. </p>
</blockquote>
<p>As mentioned above, <a href="http://code.google.com/speed/webp/">WebP</a> (pronounced “weppy”) is an all new image format set to replace the aging and bulky JPEG format, currently the king of the web. WebP, like JPEG, is a lossy compression format, so don’t expect images to look any better. However, WebP uses an entirely different compression method based on Google’s open-source <a href="http://www.webmproject.org/tools/vp8-sdk/">VP8</a> codec, which results in images approximately 40% smaller than their JPEG counterparts.</p>
<p>WebP also utilizes a new container based on <a href="http://code.google.com/speed/webp/docs/riff_container.html">RIFF</a>, allowing developers to insert metadata and potentially more future “features”. </p>
<p>Although WebP images will be smaller than JPEG versions, image quality may not be any worse, though we’ll have to wait and see for definitive proof. For a comparison, check out <a href="http://code.google.com/speed/webp/gallery.html">Google’s JPEG vs WebP gallery</a>.</p>
<p><a href="http://levelx.me/blog/wp-content/uploads/2010/10/Gallery_1286115533653.png" rel="lightbox[2673]"><img style="background-image: none; border-right-width: 0px; margin: 0px 10px 5px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Gallery_1286115533653" border="0" alt="Gallery_1286115533653" src="http://levelx.me/blog/wp-content/uploads/2010/10/Gallery_1286115533653_thumb.png" width="600" height="302" /></a></p>
<p>  <span id="more-2673"></span>
<p>The new WebP image format has the potential to really “supercharge” the web. Google estimates that 65% of all data transmitted via web page is images and photos. With the potential ability to reduce that data by nearly 40%, <em>WebP could result in your requested web pages and apps loading significantly faster</em>.</p>
<p>Not only will end user’s pages load faster, but the data centers and web hosts around the world that deliver the massive amounts of content we consume daily will appreciate the dramatically reduced load they have to carry. Google is a prime example of a company that would greatly benefit from such a significant reduction in transferred data, [hopefully] without the loss of any visual quality vs JPEG.</p>
<p>But, taking things a step further, mobile networks will absolutely love the new format. AT&amp;T has had quite a difficult time supporting the massive demand for data the iPhone has put on their network and a new image format such as this could potentially give these carriers the break they need, not to mention dramatically increase mobile web browsing speeds.</p>
<p>Here is Google’s complete blog post about the new WebP format.</p>
<blockquote><p>As part of Google’s initiative to make the web faster, over the past few months we have released a number of tools to help site owners speed up their websites. We launched the <a href="http://code.google.com/speed/page-speed/">Page Speed</a> Firefox extension to evaluate the performance of web pages and to get suggestions on how to improve them, we introduced the <a href="http://code.google.com/webtoolkit/speedtracer/">Speed Tracer</a> Chrome extension to help identify and fix performance problems in web applications, and we released a set of <a href="http://code.google.com/closure/compiler/">closure tools</a> to help build rich web applications with fully optimized JavaScript code. While these tools have been incredibly successful in helping developers optimize their sites, as we’ve evaluated our progress, we continue to notice a single component of web pages is consistently responsible for the majority of the latency on pages across the web: images.       <br />Most of the common image formats on the web today were established over a decade ago and are based on technology from around that time. Some engineers at Google decided to figure out if there was a way to further compress lossy images like JPEG to make them load faster, while still preserving quality and resolution. As part of this effort, we are releasing a developer preview of a new image format, <a href="http://code.google.com/speed/webp/">WebP</a>, that promises to significantly reduce the byte size of photos on the web, allowing web sites to load faster than before.       <br />Images and photos make up about 65% of the bytes transmitted per web page today. They can significantly slow down a user’s web experience, especially on bandwidth-constrained networks such as a mobile network. Images on the web consist primarily of lossy formats such as JPEG, and to a lesser extent lossless formats such as PNG and GIF. Our team focused on improving compression of the lossy images, which constitute the larger percentage of images on the web today.       <br />To improve on the compression that JPEG provides, we used an image compressor based on the VP8 codec that Google <a href="http://blog.webmproject.org/2010/05/introducing-webm-open-web-media-project.html">open-sourced</a> in May 2010. We applied the techniques from VP8 video intra frame coding to push the envelope in still image coding. We also adapted a very lightweight container based on <a href="http://en.wikipedia.org/wiki/Resource_Interchange_File_Format">RIFF</a>. While this container format contributes a minimal overhead of only 20 bytes per image, it is extensible to allow authors to save meta-data they would like to store.       <br />While the benefits of a VP8 based image format were clear in theory, we needed to test them in the real world. In order to gauge the effectiveness of our efforts, we randomly picked about 1,000,000 images from the web (mostly JPEGs and some PNGs and GIFs) and re-encoded them to WebP without perceptibly compromising visual quality. This resulted in an average 39% reduction in file size. We expect that developers will achieve in practice even better file size reduction with WebP when starting from an uncompressed image.       <br />To help you assess WebP’s performance with other formats, we have shared a selection of open-source and classic images along with file sizes so you can visually compare them on <a href="http://code.google.com/speed/webp/gallery.html">this site</a>. We are also releasing a conversion tool that you can use to convert images to the WebP format. We’re looking forward to working with the browser and web developer community on the WebP spec and on adding native support for WebP. While WebP images can’t be viewed until browsers support the format, we are developing a patch for WebKit to provide native support for WebP in an upcoming release of Google Chrome. We plan to add support for a transparency <a href="http://en.wikipedia.org/wiki/Layers_%28digital_image_editing%29">layer</a>, also known as <a href="http://en.wikipedia.org/wiki/Alpha_compositing">alpha</a> channel in a future update.</p>
</blockquote>
<p>Sources: <a href="http://code.google.com/speed/webp/" target="_blank">Google</a>, <a href="http://web.appstorm.net" target="_blank">Web Appstorm</a></p>
<p>But can WebP overtake the king image format JPEG. What do you think?</p>
]]></content:encoded>
			<wfw:commentRss>http://levelx.me/technology/what-is-google-webp-image-format/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Symfony 1.4 &#8211; Doctrine Timestampable Behaviour</title>
		<link>http://levelx.me/technology/programming/symfony-1-4-doctrine-timestampable-behaviour/</link>
		<comments>http://levelx.me/technology/programming/symfony-1-4-doctrine-timestampable-behaviour/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 20:04:30 +0000</pubDate>
		<dc:creator>Faizan</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[admin generator]]></category>
		<category><![CDATA[backend]]></category>
		<category><![CDATA[doctrine]]></category>
		<category><![CDATA[doctrine orm]]></category>
		<category><![CDATA[symfony]]></category>
		<category><![CDATA[symfony 1.4]]></category>
		<category><![CDATA[timestampable behavior]]></category>
		<guid isPermaLink="false">http://levelx.me/?p=1408</guid>
		<description><![CDATA[Recently Symfony released their LTS 1.4 branch. Unlike previous versions Symfony 1.4 comes with Doctrine as default ORM.  If you have worked with Doctrine&#8217;s you will be familiar with its Timestampable behavior. actAs: Timestampable: ~ Timestampable behavior  automatically adds a created_at and updated_at column and automatically set the values when a record is inserted and [...]]]></description>
			<content:encoded><![CDATA[<p>Recently <a href="http://www.symfony-project.org/" target="_blank">Symfony </a>released their LTS 1.4 branch. Unlike previous versions Symfony 1.4 comes with Doctrine as default ORM.  If you have worked with Doctrine&#8217;s you will be familiar with its Timestampable behavior.</p>
<pre>actAs:
  Timestampable: ~</pre>
<p>Timestampable behavior  automatically adds a <tt>created_at</tt> and <tt>updated_at</tt> column and automatically set the values when a record is inserted and updated.  I mostly use Symfony Admin Generator to generate Backend. This behavior worked fined till Symfony 1.2, but in Symfony 1.3 / 1.4 for unknown reasons this behavior adds created_at and updated_at fields as required and their value must be filled during creation of new record in admin generator.</p>
<p><span id="more-1408"></span></p>
<p style="text-align: left;"><a href="http://levelx.me/blog/wp-content/uploads/2010/02/timestampable.jpg" rel="lightbox[1408]"><img class="aligncenter size-full wp-image-1409" title="timestampable" src="http://levelx.me/blog/wp-content/uploads/2010/02/timestampable.jpg" alt="" width="606" height="310" /></a></p>
<p style="text-align: left;">To fix this issue open your formClass located at</p>
<pre style="text-align: left;">lib/form/doctrine/<strong>yourClass</strong>Form.Class.php</pre>
<p>replace yourClass with actuall class name <img src='http://levelx.me/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  and add following code in configure function.</p>
<pre>public function configure()
{
  //Following code will remove Required validators from these fields.
  unset($this-&gt;validatorSchema['created_at']);
  unset($this-&gt;validatorSchema['updated_at']);
  //following code will remove fields from form
  unset($this-&gt;widgetSchema['created_at']);
  unset($this-&gt;widgetSchema['updated_at']);
}</pre>
<p><span style="color: #0000ff;">Hope this help </span></p>
]]></content:encoded>
			<wfw:commentRss>http://levelx.me/technology/programming/symfony-1-4-doctrine-timestampable-behaviour/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
	</channel>
</rss>

