<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" 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:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
<channel>
	<title>Comments for Eat my monkeydust</title>
	
	<link>http://eatmymonkeydust.com</link>
	<description>Life, PHP and Symfony - straight from the monkey's mouth</description>
	<lastBuildDate>Sat, 07 Nov 2009 13:04:56 -0800</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/CommentsForEatMyMonkeydust" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>Comment on Doctrine Gotchas – delete cascade, SoftDelete and foreignType by Russ</title>
		<link>http://feedproxy.google.com/~r/CommentsForEatMyMonkeydust/~3/kEgOv3hX5SE/</link>
		<dc:creator>Russ</dc:creator>
		<pubDate>Sat, 07 Nov 2009 13:04:56 +0000</pubDate>
		<guid isPermaLink="false">http://eatmymonkeydust.com/?p=204#comment-347</guid>
		<description>@Stereoscott: In symfony, either per application (via applicationConfiguration.class.php) or normally for the entire project (projectConfiguration.class.php). I'd be careful about doing it per class, because some methods will call other methods in other classes, which may then call other queries. Since dql callbacks are turned on you may get unexpected results - it's better to know what to expect across your entire app. Saying that, I have had cases where I've had to turn callbacks off for a specific query, then immediately following the query I'll turn the setting back to it's original state.

&lt;pre lang="php"&gt;$originalAttribute = Doctrine_Manager::getInstance()-&gt;getAttribute(Doctrine::ATTR_USE_DQL_CALLBACKS);
Doctrine_Manager::getInstance()-&gt;setAttribute(Doctrine::ATTR_USE_DQL_CALLBACKS, false);

// Query

Doctrine_Manager::getInstance()-&gt;setAttribute(Doctrine::ATTR_USE_DQL_CALLBACKS, $originalAttribute);
&lt;/pre&gt;

For the second point, you are right - the example does not really reflect a real life scenario, I'll fix that in a bit!</description>
		<content:encoded><![CDATA[<p>@Stereoscott: In symfony, either per application (via applicationConfiguration.class.php) or normally for the entire project (projectConfiguration.class.php). I&#8217;d be careful about doing it per class, because some methods will call other methods in other classes, which may then call other queries. Since dql callbacks are turned on you may get unexpected results &#8211; it&#8217;s better to know what to expect across your entire app. Saying that, I have had cases where I&#8217;ve had to turn callbacks off for a specific query, then immediately following the query I&#8217;ll turn the setting back to it&#8217;s original state.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$originalAttribute</span> <span style="color: #339933;">=</span> Doctrine_Manager<span style="color: #339933;">::</span><span style="color: #004000;">getInstance</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getAttribute</span><span style="color: #009900;">&#40;</span>Doctrine<span style="color: #339933;">::</span><span style="color: #004000;">ATTR_USE_DQL_CALLBACKS</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
Doctrine_Manager<span style="color: #339933;">::</span><span style="color: #004000;">getInstance</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setAttribute</span><span style="color: #009900;">&#40;</span>Doctrine<span style="color: #339933;">::</span><span style="color: #004000;">ATTR_USE_DQL_CALLBACKS</span><span style="color: #339933;">,</span> <span style="color: #000000; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Query</span>
&nbsp;
Doctrine_Manager<span style="color: #339933;">::</span><span style="color: #004000;">getInstance</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setAttribute</span><span style="color: #009900;">&#40;</span>Doctrine<span style="color: #339933;">::</span><span style="color: #004000;">ATTR_USE_DQL_CALLBACKS</span><span style="color: #339933;">,</span> <span style="color: #000088;">$originalAttribute</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>For the second point, you are right &#8211; the example does not really reflect a real life scenario, I&#8217;ll fix that in a bit!</p>
<img src="http://feeds.feedburner.com/~r/CommentsForEatMyMonkeydust/~4/kEgOv3hX5SE" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://eatmymonkeydust.com/2009/05/doctrine-gotchas-delete-cascade-sofdelete-and-foreigntype/comment-page-1/#comment-347</feedburner:origLink></item>
	<item>
		<title>Comment on Doctrine Gotchas – delete cascade, SoftDelete and foreignType by Stereoscott</title>
		<link>http://feedproxy.google.com/~r/CommentsForEatMyMonkeydust/~3/eN-91qCq2n4/</link>
		<dc:creator>Stereoscott</dc:creator>
		<pubDate>Sat, 07 Nov 2009 09:04:50 +0000</pubDate>
		<guid isPermaLink="false">http://eatmymonkeydust.com/?p=204#comment-346</guid>
		<description>I really learned a lot from this post, thank you! I had a few questions: 1) using symfony where is a logical place to turn on DQL callbacks? In the global project configuration file? Or, is it ok to set it at the top of any methods in your class that rely on it? 2) in your "user has many payments" example, it looks to me like you'd end up with a single "payment_id" column in your user table... wouldn't you rather just put a user_id in your payments table?</description>
		<content:encoded><![CDATA[<p>I really learned a lot from this post, thank you! I had a few questions: 1) using symfony where is a logical place to turn on DQL callbacks? In the global project configuration file? Or, is it ok to set it at the top of any methods in your class that rely on it? 2) in your &#8220;user has many payments&#8221; example, it looks to me like you&#8217;d end up with a single &#8220;payment_id&#8221; column in your user table&#8230; wouldn&#8217;t you rather just put a user_id in your payments table?</p>
<img src="http://feeds.feedburner.com/~r/CommentsForEatMyMonkeydust/~4/eN-91qCq2n4" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://eatmymonkeydust.com/2009/05/doctrine-gotchas-delete-cascade-sofdelete-and-foreigntype/comment-page-1/#comment-346</feedburner:origLink></item>
	<item>
		<title>Comment on Symfony forms – Flexible widgets based on user credentials by Russ</title>
		<link>http://feedproxy.google.com/~r/CommentsForEatMyMonkeydust/~3/MdKYMso0U08/</link>
		<dc:creator>Russ</dc:creator>
		<pubDate>Tue, 20 Oct 2009 10:19:57 +0000</pubDate>
		<guid isPermaLink="false">http://eatmymonkeydust.com/?p=215#comment-345</guid>
		<description>@Hal: Yes it probably is ok to just use instanceof on its own here - I just get paranoid because a lot of php checking functions raise warnings and notices when they get the wrong types, or receive undeclared variables!

I wonder why I wrote that... I need to test it again... Maybe there was a better reason!</description>
		<content:encoded><![CDATA[<p>@Hal: Yes it probably is ok to just use instanceof on its own here &#8211; I just get paranoid because a lot of php checking functions raise warnings and notices when they get the wrong types, or receive undeclared variables!</p>
<p>I wonder why I wrote that&#8230; I need to test it again&#8230; Maybe there was a better reason!</p>
<img src="http://feeds.feedburner.com/~r/CommentsForEatMyMonkeydust/~4/MdKYMso0U08" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://eatmymonkeydust.com/2009/08/symfony-forms-flexible-widgets-based-on-user-credentials/comment-page-1/#comment-345</feedburner:origLink></item>
	<item>
		<title>Comment on Symfony forms – Flexible widgets based on user credentials by hal</title>
		<link>http://feedproxy.google.com/~r/CommentsForEatMyMonkeydust/~3/qzyLUvdqqAE/</link>
		<dc:creator>hal</dc:creator>
		<pubDate>Mon, 19 Oct 2009 22:47:16 +0000</pubDate>
		<guid isPermaLink="false">http://eatmymonkeydust.com/?p=215#comment-344</guid>
		<description>Russ
This article has helped me greatly.  Thank you for writing it.
Just one thing that I am curious about - why do you test the sfUser object using both "instance of" and is_object?  Surely, "instance of" is enough?
All the best!
Hal</description>
		<content:encoded><![CDATA[<p>Russ<br />
This article has helped me greatly.  Thank you for writing it.<br />
Just one thing that I am curious about &#8211; why do you test the sfUser object using both &#8220;instance of&#8221; and is_object?  Surely, &#8220;instance of&#8221; is enough?<br />
All the best!<br />
Hal</p>
<img src="http://feeds.feedburner.com/~r/CommentsForEatMyMonkeydust/~4/qzyLUvdqqAE" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://eatmymonkeydust.com/2009/08/symfony-forms-flexible-widgets-based-on-user-credentials/comment-page-1/#comment-344</feedburner:origLink></item>
	<item>
		<title>Comment on Symfony forms – Flexible widgets based on user credentials by Russ</title>
		<link>http://feedproxy.google.com/~r/CommentsForEatMyMonkeydust/~3/Uk1UjArsp6k/</link>
		<dc:creator>Russ</dc:creator>
		<pubDate>Thu, 15 Oct 2009 09:26:37 +0000</pubDate>
		<guid isPermaLink="false">http://eatmymonkeydust.com/?p=215#comment-343</guid>
		<description>@Alex: sfConfig::get() references the current loaded configuration, which is stored in a static array - so it is always available.

The array is populated during the application configuration and project configuration stages, which are normally done for any symfony process, including tasks, so if I'm not mistaken it's pretty safe to use. it is worth mentioning though that it will never fail - because it will always return the provided default if it doesn't find the set value.

Personally I'd try to inject any required settings into the forms' options array also, but I haven't come across an example yet so I'm keeping my options open for now!</description>
		<content:encoded><![CDATA[<p>@Alex: sfConfig::get() references the current loaded configuration, which is stored in a static array &#8211; so it is always available.</p>
<p>The array is populated during the application configuration and project configuration stages, which are normally done for any symfony process, including tasks, so if I&#8217;m not mistaken it&#8217;s pretty safe to use. it is worth mentioning though that it will never fail &#8211; because it will always return the provided default if it doesn&#8217;t find the set value.</p>
<p>Personally I&#8217;d try to inject any required settings into the forms&#8217; options array also, but I haven&#8217;t come across an example yet so I&#8217;m keeping my options open for now!</p>
<img src="http://feeds.feedburner.com/~r/CommentsForEatMyMonkeydust/~4/Uk1UjArsp6k" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://eatmymonkeydust.com/2009/08/symfony-forms-flexible-widgets-based-on-user-credentials/comment-page-1/#comment-343</feedburner:origLink></item>
	<item>
		<title>Comment on Symfony forms – Flexible widgets based on user credentials by Alex</title>
		<link>http://feedproxy.google.com/~r/CommentsForEatMyMonkeydust/~3/vNd-I0EkJrU/</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Thu, 15 Oct 2009 08:36:54 +0000</pubDate>
		<guid isPermaLink="false">http://eatmymonkeydust.com/?p=215#comment-342</guid>
		<description>Hi Russ,

Thanks. I had been reading about this on the webmozart's website as well. With you concrete example, I now changed all the forms!

I am wondering about dependency in the Symfony 2 mail function. Since it will be getting some settings with sfConfig('app_XXX'), which has to know about the context to get the right APP. I guess the same goes for the nahoMailplugin....</description>
		<content:encoded><![CDATA[<p>Hi Russ,</p>
<p>Thanks. I had been reading about this on the webmozart&#8217;s website as well. With you concrete example, I now changed all the forms!</p>
<p>I am wondering about dependency in the Symfony 2 mail function. Since it will be getting some settings with sfConfig(&#8217;app_XXX&#8217;), which has to know about the context to get the right APP. I guess the same goes for the nahoMailplugin&#8230;.</p>
<img src="http://feeds.feedburner.com/~r/CommentsForEatMyMonkeydust/~4/vNd-I0EkJrU" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://eatmymonkeydust.com/2009/08/symfony-forms-flexible-widgets-based-on-user-credentials/comment-page-1/#comment-342</feedburner:origLink></item>
	<item>
		<title>Comment on Symfony sfGuardUser “remember me” checkbox/cookie does not work by charles</title>
		<link>http://feedproxy.google.com/~r/CommentsForEatMyMonkeydust/~3/uQvurVygIBo/</link>
		<dc:creator>charles</dc:creator>
		<pubDate>Fri, 09 Oct 2009 14:15:55 +0000</pubDate>
		<guid isPermaLink="false">http://eatmymonkeydust.com/?p=34#comment-341</guid>
		<description>Hi,

I'm concerned about this IP checking thing. Your solution worked like a charm for me but for a day only, since most ISPs renew their IPs each day when you get back to your site the day after your cookie value no longer matches your IP which has probably changed over night. I'm working on a solution that does not rely on your IP. Keep you guys posted...</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I&#8217;m concerned about this IP checking thing. Your solution worked like a charm for me but for a day only, since most ISPs renew their IPs each day when you get back to your site the day after your cookie value no longer matches your IP which has probably changed over night. I&#8217;m working on a solution that does not rely on your IP. Keep you guys posted&#8230;</p>
<img src="http://feeds.feedburner.com/~r/CommentsForEatMyMonkeydust/~4/uQvurVygIBo" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://eatmymonkeydust.com/2008/07/symfony-sfguarduser-remember-me-checkboxcookie-does-not-work/comment-page-1/#comment-341</feedburner:origLink></item>
	<item>
		<title>Comment on PHP Session settings ignored? by Russ</title>
		<link>http://feedproxy.google.com/~r/CommentsForEatMyMonkeydust/~3/Zy6r8MXX4lw/</link>
		<dc:creator>Russ</dc:creator>
		<pubDate>Sat, 03 Oct 2009 18:52:48 +0000</pubDate>
		<guid isPermaLink="false">http://eatmymonkeydust.com/?p=229#comment-340</guid>
		<description>ok, fixed :) Of course symfony always sets this value in php based on the setting in factories.yml and therein lies the problem!</description>
		<content:encoded><![CDATA[<p>ok, fixed <img src='http://eatmymonkeydust.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Of course symfony always sets this value in php based on the setting in factories.yml and therein lies the problem!</p>
<img src="http://feeds.feedburner.com/~r/CommentsForEatMyMonkeydust/~4/Zy6r8MXX4lw" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://eatmymonkeydust.com/2009/10/php-session-settings-ignored/comment-page-1/#comment-340</feedburner:origLink></item>
	<item>
		<title>Comment on PHP Session settings ignored? by Hannes Magnusson</title>
		<link>http://feedproxy.google.com/~r/CommentsForEatMyMonkeydust/~3/JmgH5HsXvf0/</link>
		<dc:creator>Hannes Magnusson</dc:creator>
		<pubDate>Sat, 03 Oct 2009 18:03:32 +0000</pubDate>
		<guid isPermaLink="false">http://eatmymonkeydust.com/?p=229#comment-339</guid>
		<description>No no..
Its not regardless what you have in php.ini. It does respect php.ini, just nothing else :)
Setting this option in httpd.conf, .htaccess, or in PHP script doesn't work on Debian based systems :(</description>
		<content:encoded><![CDATA[<p>No no..<br />
Its not regardless what you have in php.ini. It does respect php.ini, just nothing else <img src='http://eatmymonkeydust.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Setting this option in httpd.conf, .htaccess, or in PHP script doesn&#8217;t work on Debian based systems <img src='http://eatmymonkeydust.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<img src="http://feeds.feedburner.com/~r/CommentsForEatMyMonkeydust/~4/JmgH5HsXvf0" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://eatmymonkeydust.com/2009/10/php-session-settings-ignored/comment-page-1/#comment-339</feedburner:origLink></item>
	<item>
		<title>Comment on Symfony sfGuardUser “remember me” checkbox/cookie does not work by saturn1</title>
		<link>http://feedproxy.google.com/~r/CommentsForEatMyMonkeydust/~3/bMdUtDvh1oI/</link>
		<dc:creator>saturn1</dc:creator>
		<pubDate>Sun, 06 Sep 2009 19:21:15 +0000</pubDate>
		<guid isPermaLink="false">http://eatmymonkeydust.com/?p=34#comment-338</guid>
		<description>Thank you, very usefull :)</description>
		<content:encoded><![CDATA[<p>Thank you, very usefull <img src='http://eatmymonkeydust.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<img src="http://feeds.feedburner.com/~r/CommentsForEatMyMonkeydust/~4/bMdUtDvh1oI" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://eatmymonkeydust.com/2008/07/symfony-sfguarduser-remember-me-checkboxcookie-does-not-work/comment-page-1/#comment-338</feedburner:origLink></item>
</channel>
</rss>
