<?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>insightmedia</title>
	<atom:link href="http://insightmed.eu/blog/feed" rel="self" type="application/rss+xml" />
	<link>http://insightmed.eu/blog</link>
	<description>be the change you want to see in the world</description>
	<lastBuildDate>Thu, 30 Jun 2011 21:23:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Embedding multiple forms with symfony &#8230; hardcore :)</title>
		<link>http://insightmed.eu/blog/programming-scripting/embedding-multiple-forms-symfony_2011_06.html</link>
		<comments>http://insightmed.eu/blog/programming-scripting/embedding-multiple-forms-symfony_2011_06.html#comments</comments>
		<pubDate>Thu, 30 Jun 2011 21:13:01 +0000</pubDate>
		<dc:creator>dan.hawk</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming / Scripting]]></category>
		<category><![CDATA[Symfony]]></category>
		<category><![CDATA[embed form symfony]]></category>
		<category><![CDATA[embed multiple forms symfony]]></category>
		<category><![CDATA[embed relation symfony]]></category>

		<guid isPermaLink="false">http://insightmed.eu/blog/?p=190</guid>
		<description><![CDATA[Well this should be one of the last posts about branch 1.x of symfony. The 2nd version should come to alpha soon so there is no real need to go further with it. Anyway &#8230; some time ago I desperately needed a quick and reliable way to embed multiple symfony forms on one page and]]></description>
			<content:encoded><![CDATA[<p>Well this should be one of the last posts about branch 1.x of symfony. The 2nd version should come to alpha soon so there is no real need to go further with it. Anyway &#8230; some time ago I desperately needed a quick and reliable way to embed multiple symfony forms on one page and submit them at once. I generally take the time to look into the source files, but this time i was in a hurry. So this is the &#8220;hacky&#8221; way i got around:</p>
<pre class="brush:php">
function executeMoo(sfWebRequest $request) {
$this-&gt;forms = array();

$it = 0;

foreach($some_model as $s) {

$f = new MooForm($s);

$f-&gt;getWidgetSchema()-&gt;setNameFormat('foo[' . $form-&gt;getName() . $it . '][%s]');

$this-&gt;form-&gt;embedForm($it, $form);
$this-&gt;forms[] = $this-&gt;form;
$it++;

}
}</pre>
<p>The presentation part should be as simple as:</p>
<pre class="brush:php">
&lt;form ...&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td&gt;&lt;table&gt;
&lt;?php
foreach($forms as $form) :
   echo $form;
endforeach;
?>
&lt;/table&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/form&gt;
&lt;/pre&gt;
</pre>
<p>Ok now for the validation part:</p>
<pre class="brush:php">
public function executeSubmit_Foo(sfWebRequest $request) {
         $this->forward404Unless($request->isMethod(sfRequest::POST));

   	$base_forms = $request->getParameter('foo');

	foreach($base_forms as $base_form) {
		$f = new MooForm();
		$f->bind($base_form,null);
		if($f->isValid()) {
			$f->save();
		}
	}
}
</pre>
<p>What&#8217;s the catch?<br />
Well the catch is in this line: $f-&gt;getWidgetSchema()-&gt;setNameFormat(&#8216;foo[' . $form-&gt;getName() . $it . '][%s]&#8216;);<br />
What it really does? it generates the form fields like foo['forms_name1'] &#8230; so the only thing you have to do is grabbing the foo var from request and looping through to get the embedded forms.<br />
Sure there are better ways, but this worked nice with a minimum ammount of time spent.<br />
Hope it helps.</p>
]]></content:encoded>
			<wfw:commentRss>http://insightmed.eu/blog/programming-scripting/embedding-multiple-forms-symfony_2011_06.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows reloaded or failure reloaded?</title>
		<link>http://insightmed.eu/blog/general-stuff/windows-reloaded-failure-reloaded_2011_06.html</link>
		<comments>http://insightmed.eu/blog/general-stuff/windows-reloaded-failure-reloaded_2011_06.html#comments</comments>
		<pubDate>Fri, 03 Jun 2011 19:07:50 +0000</pubDate>
		<dc:creator>dan.hawk</dc:creator>
				<category><![CDATA[General stuff]]></category>
		<category><![CDATA[new windows]]></category>
		<category><![CDATA[windows 8]]></category>
		<category><![CDATA[windows 8 ui]]></category>
		<category><![CDATA[windows reloaded]]></category>

		<guid isPermaLink="false">http://insightmed.eu/blog/?p=175</guid>
		<description><![CDATA[Today i had some time to look inside of some newsletter i got in the last few days. One of them seemed pretty interesting because it was talking about a totally new Windows, with cool new stuff(yeah heard that before) and a complete new design(same here). While i wasn&#8217;t quite convinced about the last, i]]></description>
			<content:encoded><![CDATA[<p>Today i had some time to look inside of some newsletter i got in the last few days. One of them seemed pretty interesting because it was talking about a totally new Windows, with cool new stuff(yeah heard that before) and a complete new design(same here). While i wasn&#8217;t quite convinced about the last, i took a look at one of the videos presenting the new redesigned UI. In my oppion the changes look good, though they don&#8217;t bring something really spectacular compared to competition (in fact it shouldn&#8217;t, as it has to be still friendly for people coming from prior versions), but it&#8217;s a good change that strengthens my belief that Windows is one of the best choices for most of the people when it comes to daily computer usage. One interesting thing is that Microsoft started to impose restrictions for the Windows 8 tablet chipmakers according to windows8center.com, which in my oppinion is one of the best things they&#8217;ve did in the past decade &#8230; it should bring more quality, lower prices and most of all &#8230; a better experience(did they finally learn the apple philosophy?). &#8211; original post <a href="http://windows8center.com/news/microsoft-to-impose-one-tablet-only-restriction-for-windows-8-tablet-chipmakers/">here</a></p>
<p>Anyway here are the videos.<br />
<object style="height: 390px; width: 640px;"><param name="movie" value="http://www.youtube.com/v/p92QfWOw88I?version=3" /><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><embed type="application/x-shockwave-flash" width="640" height="390" src="http://www.youtube.com/v/p92QfWOw88I?version=3" allowfullscreen="true" allowscriptaccess="always"></embed></object></p>
<p>And second one from the Windows 8 presentation in taiwan.<br />
<iframe class="iframe-class" width="640" height="360" src="http://www.microsoft.com:80/presspass/silverlightApps/videoplayer3/standalone.aspx?contentID=win8_preview1&amp;src=/presspass/presskits/windows7/channel.xml" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" allowtransparency="true"></iframe></p>
<p>More information can be found on windows8center.com</p>
]]></content:encoded>
			<wfw:commentRss>http://insightmed.eu/blog/general-stuff/windows-reloaded-failure-reloaded_2011_06.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using the right tools at the right time</title>
		<link>http://insightmed.eu/blog/general-stuff/tools-time_2011_05.html</link>
		<comments>http://insightmed.eu/blog/general-stuff/tools-time_2011_05.html#comments</comments>
		<pubDate>Fri, 27 May 2011 07:36:56 +0000</pubDate>
		<dc:creator>dan.hawk</dc:creator>
				<category><![CDATA[General stuff]]></category>
		<category><![CDATA[Usefull stuff]]></category>
		<category><![CDATA[keep it simple]]></category>

		<guid isPermaLink="false">http://insightmed.eu/blog/?p=171</guid>
		<description><![CDATA[Reading my daily dose of feeds on GReader, i came across on an older post from Bruno Lowagie&#8217;s blog (if iText rings any bells) explaining why software needs to be kept simple and oriented to its designed role and not doing a ton of things that don&#8217;t have anything to do with the initial target.]]></description>
			<content:encoded><![CDATA[<p>Reading my daily dose of feeds on GReader, i came across on an older post from Bruno Lowagie&#8217;s blog (if iText rings any bells) explaining why software needs to be kept simple and oriented to its designed role and not doing a ton of things that don&#8217;t have anything to do with the initial target. I don&#8217;t know why but the story amuzes me everytime i read it. here it is:</p>
<p><a title="Don't eat soup with a fork" href="http://www.lowagie.com/node/136" target="_blank">Don&#8217;t eat soup with a fork</a></p>
]]></content:encoded>
			<wfw:commentRss>http://insightmed.eu/blog/general-stuff/tools-time_2011_05.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Will Microsoft screw up on this too?</title>
		<link>http://insightmed.eu/blog/general-stuff/microsoft-screw_2011_05.html</link>
		<comments>http://insightmed.eu/blog/general-stuff/microsoft-screw_2011_05.html#comments</comments>
		<pubDate>Wed, 11 May 2011 22:57:29 +0000</pubDate>
		<dc:creator>dan.hawk</dc:creator>
				<category><![CDATA[General stuff]]></category>

		<guid isPermaLink="false">http://insightmed.eu/blog/?p=169</guid>
		<description><![CDATA[Rumours are getting bigger and bigger everyday about Microsoft taking over Skype for 8.5 billion. At first look seems like a good move for Microsoft as Skype is in someway the missing link to the top of mobile/internet business. Everything seems great, but as far as users are concerned Microsoft does not have a good]]></description>
			<content:encoded><![CDATA[<p>Rumours are getting bigger and bigger everyday about Microsoft taking over Skype for 8.5 billion. At first look seems like a good move for Microsoft as Skype is in someway the missing link to the top of mobile/internet business. Everything seems great, but as far as users are concerned Microsoft does not have a good history when it comes to marketing/making stuff for mobiles or web. Only time can tell though if this is a good move both for Microsoft and for the users.</p>
<p>&nbsp;</p>
<p>Original article here:</p>
<p><a href="http://techcrunch.com/2011/05/09/microsoft-skype/?utm_source=feedburner&amp;utm_medium=feed&amp;utm_campaign=Feed%3A+Techcrunch+%28TechCrunch%29">http://techcrunch.com/2011/05/09/microsoft-skype/?utm_source=feedburner&amp;utm_medium=feed&amp;utm_campaign=Feed%3A+Techcrunch+%28TechCrunch%29</a></p>
]]></content:encoded>
			<wfw:commentRss>http://insightmed.eu/blog/general-stuff/microsoft-screw_2011_05.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[rb] Fonts and their open source alternatives</title>
		<link>http://insightmed.eu/blog/general-stuff/rb-fonts-open-source-alternatives_2011_05.html</link>
		<comments>http://insightmed.eu/blog/general-stuff/rb-fonts-open-source-alternatives_2011_05.html#comments</comments>
		<pubDate>Wed, 11 May 2011 19:32:15 +0000</pubDate>
		<dc:creator>dan.hawk</dc:creator>
				<category><![CDATA[General stuff]]></category>
		<category><![CDATA[Usefull stuff]]></category>
		<category><![CDATA[web fonts]]></category>

		<guid isPermaLink="false">http://insightmed.eu/blog/?p=165</guid>
		<description><![CDATA[Swiss 921 &#8211; Antone by Vernon Adams [http://www.google.com/webfonts/preview#font-family=Anton] &#160; * to be updated *]]></description>
			<content:encoded><![CDATA[<p>Swiss 921 &#8211; Antone by Vernon Adams [<a href="http://www.google.com/webfonts/preview#font-family=Anton">http://www.google.com/webfonts/preview#font-family=Anton</a>]</p>
<p>&nbsp;</p>
<p>* to be updated *</p>
]]></content:encoded>
			<wfw:commentRss>http://insightmed.eu/blog/general-stuff/rb-fonts-open-source-alternatives_2011_05.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[rb]Custom doctrine count query</title>
		<link>http://insightmed.eu/blog/uncategorized/rbcustom-doctrine-count-query_2011_05.html</link>
		<comments>http://insightmed.eu/blog/uncategorized/rbcustom-doctrine-count-query_2011_05.html#comments</comments>
		<pubDate>Sat, 07 May 2011 20:07:19 +0000</pubDate>
		<dc:creator>dan.hawk</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming / Scripting]]></category>
		<category><![CDATA[Symfony]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[custom count query doctrine]]></category>
		<category><![CDATA[doctrine count]]></category>
		<category><![CDATA[doctrine query count]]></category>

		<guid isPermaLink="false">http://insightmed.eu/blog/?p=156</guid>
		<description><![CDATA[Sometimes you may need to use count with the index column rather than *, because of some dark corners of sql driven databases. Though this is somehow rare, this is how you could do it with Doctrine &#8230; this example is part of a symfony 1.4 project(place the file in any of the /lib dirs]]></description>
			<content:encoded><![CDATA[<p>Sometimes you may need to use count with the index column rather than *, because of some dark corners of sql driven databases. Though this is somehow rare, this is how you could do it with Doctrine &#8230; this example is part of a symfony 1.4 project(place the file in any of the /lib dirs &#8230; app ones or global one):</p>
<pre class="brush:php">&lt;?php

class Custom_Doctrine_Query extends Doctrine_Query {

public static function create($conn = null, $class = null)
{
if ( ! $class) {
$class = 'Custom_Doctrine_Query';
}
return new $class($conn);

}

public function getCustomCountSqlQuery()
{
// triggers dql parsing/processing
$this-&gt;getSqlQuery(array(), false); // this is ugly

// initialize temporary variables
$where   = $this-&gt;_sqlParts['where'];
$having  = $this-&gt;_sqlParts['having'];
$groupby = $this-&gt;_sqlParts['groupby'];

$rootAlias = $this-&gt;getRootAlias();
$tableAlias = $this-&gt;getSqlTableAlias($rootAlias);
$primaryKey = $tableAlias . '.' .  $this-&gt;_queryComponents[$rootAlias]['table']-&gt;getColumnName( $this-&gt;_queryComponents[$rootAlias]['table']-&gt;getIdentifier());

// Build the query base
$q = 'SELECT COUNT(' .  $primaryKey . ') AS ' . $this-&gt;_conn-&gt;quoteIdentifier('num_results') . ' FROM ';

// Build the from clause
$from = $this-&gt;_buildSqlFromPart(true);

// Build the where clause
$where = ( ! empty($where)) ? ' WHERE ' . implode(' ', $where) : '';

// Build the group by clause
$groupby = ( ! empty($groupby)) ? ' GROUP BY ' . implode(', ', $groupby) : '';

// Build the having clause
$having = ( ! empty($having)) ? ' HAVING ' . implode(' AND ', $having) : '';

// Building the from clause and finishing query
if (count($this-&gt;_queryComponents) == 1 &amp;&amp; empty($having)) {
$q .= $from . $where . $groupby . $having;
} else {
// Subselect fields will contain only the pk of root entity
$ta = $this-&gt;_conn-&gt;quoteIdentifier($tableAlias);

$map = $this-&gt;getRootDeclaration();
$idColumnNames = $map['table']-&gt;getIdentifierColumnNames();

$pkFields = $ta . '.' . implode(', ' . $ta . '.', $this-&gt;_conn-&gt;quoteMultipleIdentifier($idColumnNames));

// We need to do some magic in select fields if the query contain anything in having clause
$selectFields = $pkFields;

if ( ! empty($having)) {
// For each field defined in select clause
foreach ($this-&gt;_sqlParts['select'] as $field) {
// We only include aggregate expressions to count query
// This is needed because HAVING clause will use field aliases
if (strpos($field, '(') !== false) {
$selectFields .= ', ' . $field;
}
}
// Add having fields that got stripped out of select
preg_match_all('/`[a-z0-9_]+`\.`[a-z0-9_]+`/i', $having, $matches, PREG_PATTERN_ORDER);
if (count($matches[0]) &gt; 0) {
$selectFields .= ', ' . implode(', ', array_unique($matches[0]));
}
}

// If we do not have a custom group by, apply the default one
if (empty($groupby)) {
$groupby = ' GROUP BY ' . $pkFields;
}

$q .= '(SELECT ' . $selectFields . ' FROM ' . $from . $where . $groupby . $having . ') '
. $this-&gt;_conn-&gt;quoteIdentifier('dctrn_count_query');
}

return $q;
}

public function count($params = array())
{
$q = $this-&gt;getCustomCountSqlQuery();
$params = $this-&gt;getCountQueryParams($params);
$params = $this-&gt;_conn-&gt;convertBooleans($params);

if ($this-&gt;_resultCache) {
$conn = $this-&gt;getConnection();
$cacheDriver = $this-&gt;getResultCacheDriver();
$hash = $this-&gt;getResultCacheHash($params).'_count';
$cached = ($this-&gt;_expireResultCache) ? false : $cacheDriver-&gt;fetch($hash);

if ($cached === false) {
// cache miss
$results = $this-&gt;getConnection()-&gt;fetchAll($q, $params);
$cacheDriver-&gt;save($hash, serialize($results), $this-&gt;getResultCacheLifeSpan());
} else {
$results = unserialize($cached);
}
} else {
$results = $this-&gt;getConnection()-&gt;fetchAll($q, $params);
}

if (count($results) &gt; 1) {
$count = count($results);
} else {
if (isset($results[0])) {
$results[0] = array_change_key_case($results[0], CASE_LOWER);
$count = $results[0]['num_results'];
} else {
$count = 0;
}
}

return (int) $count;
}

}</pre>
<p>The usage of the above class should be something like this:</p>
<pre class="brush:php">$query = Custom_Doctrine_Query::create()-&gt;from('TargetTable t');
$count = $query-&gt;count();</pre>
<p>or the bulky way omitting the static create method:</p>
<pre class="brush:php">$query = Doctrine_Query::create(null, 'Custom_Doctrine_Query')-&gt;from('TargetTable t');
$count = $query-&gt;count();</pre>
<p>The result of the above queries should be something like &#8220;SELECT COUNT(index_field) from target_table&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://insightmed.eu/blog/uncategorized/rbcustom-doctrine-count-query_2011_05.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Intel reinvents the micro-chip design</title>
		<link>http://insightmed.eu/blog/uncategorized/intel-reinvents-micro-chip-design_2011_05.html</link>
		<comments>http://insightmed.eu/blog/uncategorized/intel-reinvents-micro-chip-design_2011_05.html#comments</comments>
		<pubDate>Sat, 07 May 2011 10:27:23 +0000</pubDate>
		<dc:creator>dan.hawk</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[intel 22nm]]></category>
		<category><![CDATA[intel micro-chip design]]></category>
		<category><![CDATA[intel tri-gate]]></category>
		<category><![CDATA[intel's new processors]]></category>

		<guid isPermaLink="false">http://insightmed.eu/blog/?p=153</guid>
		<description><![CDATA[Intel presented 2 days ago at San Francisco, one of the biggest breakthroughs of the last decade regarding the design of microchips, on which the new 22nm processor generations will be based. More information about it can be found here: Transistors go 3D as Intel re-invents the microchip and here Intel 22nm 3-D Tri-Gate Transistor]]></description>
			<content:encoded><![CDATA[<p>Intel presented 2 days ago at San Francisco, one of the biggest breakthroughs of the last decade regarding the design of microchips, on which the new 22nm processor generations will be based. More information about it can be found here:</p>
<p><a href="http://arstechnica.com/business/news/2011/05/intel-re-invents-the-microchip.ars">Transistors go 3D as Intel re-invents the microchip</a></p>
<p>and here</p>
<p><a href="http://newsroom.intel.com/docs/DOC-2032">Intel 22nm 3-D Tri-Gate Transistor Technology</a></p>
]]></content:encoded>
			<wfw:commentRss>http://insightmed.eu/blog/uncategorized/intel-reinvents-micro-chip-design_2011_05.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WTH swiftmailer</title>
		<link>http://insightmed.eu/blog/programming-scripting/wth-swiftmailer_2011_04.html</link>
		<comments>http://insightmed.eu/blog/programming-scripting/wth-swiftmailer_2011_04.html#comments</comments>
		<pubDate>Sat, 09 Apr 2011 21:33:56 +0000</pubDate>
		<dc:creator>dan.hawk</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming / Scripting]]></category>
		<category><![CDATA[Symfony]]></category>
		<category><![CDATA[Swift_KeyCache_KeyCacheInputStream]]></category>
		<category><![CDATA[Swift_KeyCache_KeyCacheInputStream interface]]></category>
		<category><![CDATA[Swift_KeyCache_KeyCacheInputStream missing]]></category>

		<guid isPermaLink="false">http://insightmed.eu/blog/?p=148</guid>
		<description><![CDATA[Now it&#8217;s kindda obvious that swift mailer is the best php mail library, but as any other great php library it sometimes lets you right in the middle of nowhere, when you&#8217;re thinking everything should be fine. This was the case with a freshly downloaded version &#8230; everything went fine until Swift_KeyCache_KeyCacheInputStream interface not found]]></description>
			<content:encoded><![CDATA[<p>Now it&#8217;s kindda obvious that swift mailer is the best php mail library, but as any other great php library it sometimes lets you right in the middle of nowhere, when you&#8217;re thinking everything should be fine. This was the case with a freshly downloaded version &#8230; everything went fine until <em>Swift_KeyCache_KeyCacheInputStream interface not found in</em> &#8230; to shorten the story &#8230; swift looks for that interface which is expected to be in the file KeyCache.php &#8230; the declaration seems to be missing from the downloaded package &#8230; the fix is pretty simple(though there is probably a good reason why it isn&#8217;t there anymore, but for a quick fix will do) &#8230; open /classes/Swift/KeyCache.php and add these lines:</p>
<pre class="brush:php">
interface Swift_KeyCache_KeyCacheInputStream extends Swift_InputByteStream
{

	public function setKeyCache(Swift_KeyCache $keyCache);

	public function setNsKey($nsKey);
	public function setItemKey($itemKey);
	public function setWriteThroughStream(Swift_InputByteStream $is);
	public function __clone();
}
</pre>
<p>save it &#8230; and you&#8217;re good to go.</p>
]]></content:encoded>
			<wfw:commentRss>http://insightmed.eu/blog/programming-scripting/wth-swiftmailer_2011_04.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[snip] Doctrine update enum field</title>
		<link>http://insightmed.eu/blog/uncategorized/snip-doctrine-update-enum-field_2011_02.html</link>
		<comments>http://insightmed.eu/blog/uncategorized/snip-doctrine-update-enum-field_2011_02.html#comments</comments>
		<pubDate>Sat, 05 Feb 2011 12:24:56 +0000</pubDate>
		<dc:creator>dan.hawk</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[doctrine enum field]]></category>
		<category><![CDATA[doctrine update enum]]></category>

		<guid isPermaLink="false">http://insightmed.eu/blog/?p=183</guid>
		<description><![CDATA[$query = Doctrine_Query::create()->update('table')->set('field',Doctrine_Manager::connection()->quote('some_value', 'text'))->where('id = ?', $id);]]></description>
			<content:encoded><![CDATA[<pre class="brush:php">
$query = Doctrine_Query::create()->update('table')->set('field',Doctrine_Manager::connection()->quote('some_value', 'text'))->where('id = ?', $id);
</pre>
]]></content:encoded>
			<wfw:commentRss>http://insightmed.eu/blog/uncategorized/snip-doctrine-update-enum-field_2011_02.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[rb]symfony&#8217;s 1.4 sfForm isValid()</title>
		<link>http://insightmed.eu/blog/programming-scripting/rbsymfonys-1-4-sfform-isvalid_2011_02.html</link>
		<comments>http://insightmed.eu/blog/programming-scripting/rbsymfonys-1-4-sfform-isvalid_2011_02.html#comments</comments>
		<pubDate>Thu, 03 Feb 2011 13:14:39 +0000</pubDate>
		<dc:creator>dan.hawk</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming / Scripting]]></category>
		<category><![CDATA[Symfony]]></category>
		<category><![CDATA[sfForm]]></category>
		<category><![CDATA[sfForm isValid]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://insightmed.eu/blog/?p=140</guid>
		<description><![CDATA[Someone asked me a few days ago how can he use the sfform validation feature to validate an object created &#8220;by hand&#8221;. While i&#8217;m not quite sure yet of the usage of such a thing, here&#8217;s my approach(we&#8217;ll assume we have a table called Selections with 4 fields like id(incremental/key/bigint), target_id(bigint), type(varchar), name(varchar)): public function]]></description>
			<content:encoded><![CDATA[<p>Someone asked me a few days ago how can he use the sfform validation feature to validate an object created &#8220;by hand&#8221;. While i&#8217;m not quite sure yet of the usage of such a thing, here&#8217;s my approach(we&#8217;ll assume we have a table called Selections with 4 fields like id(incremental/key/bigint), target_id(bigint), type(varchar),  name(varchar)):</p>
<pre class="brush:php">public function executeAdd(sfWebRequest $request) {
if($request-&gt;isXmlHttpRequest()) {

$this-&gt;setLayout(false);

$this-&gt;forward404Unless($id = $request-&gt;getParameter('id'));
$this-&gt;forward404Unless($type = $request-&gt;getParameter('type'));
$selection = new Selections();
$selection-&gt;setTargetId($id);
$selection-&gt;setType(ucfirst($type));
$selection-&gt;setName('DEFAULT');

$form = new SelectionsForm(null, array(), false);
$values = $selection-&gt;toArray();
$form-&gt;bind($values);

if($form-&gt;isValid()) { $form-&gt;save(); echo 'OK'; }
else {
echo 'ERROR';
}

return sfView::NONE;
} else $this-&gt;forward404();
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://insightmed.eu/blog/programming-scripting/rbsymfonys-1-4-sfform-isvalid_2011_02.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

