<?xml version="1.0" encoding="utf-8" ?>

<rdf:RDF 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns="http://my.netscape.com/rdf/simple/0.9/">
<channel>
    <title>Bisna Blog</title>
    <link>http://blog.bisna.com/</link>
    <description></description>
    <dc:language>en</dc:language>

    <image rdf:resource="http://blog.bisna.com/templates/default/img/s9y_banner_small.png" />

    <items>
      <rdf:Seq>
        <rdf:li resource="http://blog.bisna.com/index.php?/archives/5.html" />
        <rdf:li resource="http://blog.bisna.com/index.php?/archives/4.html" />
        <rdf:li resource="http://blog.bisna.com/index.php?/archives/3.html" />
        <rdf:li resource="http://blog.bisna.com/index.php?/archives/2.html" />
        <rdf:li resource="http://blog.bisna.com/index.php?/archives/1.html" />
      </rdf:Seq>
    </items>
</channel>

<image rdf:about="http://blog.bisna.com/templates/default/img/s9y_banner_small.png">
        <url>http://blog.bisna.com/templates/default/img/s9y_banner_small.png</url>
        <title>RSS: Bisna Blog - </title>
        <link>http://blog.bisna.com/</link>
        <width>100</width>
        <height>21</height>
    </image>


<item rdf:about="http://blog.bisna.com/index.php?/archives/5.html">
    <title>Turning array-hydrated resultset of a Doctrine Model into a tree structure</title>
    <link>http://blog.bisna.com/index.php?/archives/Turning-array-hydrated-resultset-of-a-Doctrine-Model-into-a-tree-structure.html</link>
    <description>
    Too many people request me this enhancement, also it should be included in 1.1 branch.&lt;br /&gt;
Unfortunately, I did this method AFTER Doctrine 1.1 became feature freezed, so it could not be included in distribution.&lt;br /&gt;
&lt;br /&gt;
I actually didn&#039;t finish the implementation of this. It currently only deals with array-hydrated resultsets. When I was building it, I found a couple of needed changes into 1.1 that I did until the feature freeze, so the record-hydrated resultset is easy enough to accomplish too. To include the support, just use mapValue() method.&lt;br /&gt;
&lt;br /&gt;
I usually create a DoctrineX_NestedSet class to support this and also other methods.&lt;br /&gt;
Feel free to use it as you want.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt; DoctrineX_NestedSet&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; public &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/static&#039;);&quot;  href=&quot;http://www.php.net/static&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;static&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; toHierarchy&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$collection&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Trees mapped&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$trees&lt;/span&gt; = &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/array&#039;);&quot;  href=&quot;http://www.php.net/array&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$l&lt;/span&gt; = &lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/count&#039;);&quot;  href=&quot;http://www.php.net/count&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;count&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$collection&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &amp;gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Node Stack. Used to help building the hierarchy&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$stack&lt;/span&gt; = &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/array&#039;);&quot;  href=&quot;http://www.php.net/array&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;foreach&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$collection&lt;/span&gt; &lt;span style=&quot;color: #b1b100;&quot;&gt;as&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$child&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$item&lt;/span&gt; = &lt;span style=&quot;color: #0000ff;&quot;&gt;$child&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$item&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;__children&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt; = &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/array&#039;);&quot;  href=&quot;http://www.php.net/array&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Number of stack items&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$l&lt;/span&gt; = &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/count&#039;);&quot;  href=&quot;http://www.php.net/count&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;count&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$stack&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Check if we&#039;re dealing with different levels&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;while&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$l&lt;/span&gt; &amp;gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt; &amp;amp;&amp;amp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$stack&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$l&lt;/span&gt; - &lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;level&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt; &amp;gt;= &lt;span style=&quot;color: #0000ff;&quot;&gt;$item&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;level&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/array_pop&#039;);&quot;  href=&quot;http://www.php.net/array_pop&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;array_pop&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$stack&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$l&lt;/span&gt;--;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Stack is empty (we are inspecting the root)&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$l&lt;/span&gt; == &lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Assigning the root child&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$i&lt;/span&gt; = &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/count&#039;);&quot;  href=&quot;http://www.php.net/count&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;count&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$trees&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$trees&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$i&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt; = &lt;span style=&quot;color: #0000ff;&quot;&gt;$item&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$stack&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt; = &amp;amp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$trees&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$i&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt; &lt;span style=&quot;color: #b1b100;&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Add child to parent&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$i&lt;/span&gt; = &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/count&#039;);&quot;  href=&quot;http://www.php.net/count&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;count&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$stack&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$l&lt;/span&gt; - &lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;__children&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$stack&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$l&lt;/span&gt; - &lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;__children&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$i&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt; = &lt;span style=&quot;color: #0000ff;&quot;&gt;$item&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$stack&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt; = &amp;amp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$stack&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$l&lt;/span&gt; - &lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;__children&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$i&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$trees&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Just remember to ORDER BY root_id AND lft ascending and to select level column!&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// ...&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$rs&lt;/span&gt; = &lt;span style=&quot;color: #0000ff;&quot;&gt;$q&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;execute&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$params&lt;/span&gt;, Doctrine::&lt;span style=&quot;color: #006600;&quot;&gt;HYDRATE_ARRAY&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$trees&lt;/span&gt; = DoctrineX_NestedSet::&lt;span style=&quot;color: #006600;&quot;&gt;toHierarchy&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$rs&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/div&gt; 
    </description>

    <dc:publisher>Bisna Blog</dc:publisher>
    <dc:creator>nospam@example.com (Guilherme Blanco)</dc:creator>
    <dc:subject>
    </dc:subject>
    <dc:date>2009-03-30T13:41:14Z</dc:date>
    <wfw:comment>http://blog.bisna.com/wfwcomment.php?cid=5</wfw:comment>
        <slash:comments>1</slash:comments>
        <wfw:commentRss>http://blog.bisna.com/rss.php?version=1.0&amp;type=comments&amp;cid=5</wfw:commentRss>
    
    
</item>
<item rdf:about="http://blog.bisna.com/index.php?/archives/4.html">
    <title>Seven things you probably don't know about me</title>
    <link>http://blog.bisna.com/index.php?/archives/Seven-things-you-probably-dont-know-about-me.html</link>
    <description>
    Ok, I got tagged by &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.rafaeldohms.com.br/?language=en&#039;);&quot;  href=&quot;http://www.rafaeldohms.com.br/?language=en&quot;&gt;Rafael Dohms&lt;/a&gt;...&lt;br /&gt;
&lt;br /&gt;
You may see that this blog is not too much updated, but I&#039;ll try from now to stay engadget with community.&lt;br /&gt;
Here is my list... no particular order, just remembering and typing:&lt;br /&gt;
&lt;br /&gt;
- &lt;strong&gt;Once I won a chess match with the São Paulo state champion.&lt;/strong&gt; When I was on primary school, I participate on a tournament that was suppose to play with the São Paulo state chess champion and also later a season with other players until the winner appears.&lt;br /&gt;
I played twice with the guy and one of those games I won. He invited me to go to his chess school... and he&#039;s probably waiting me until now... lol&lt;br /&gt;
&lt;br /&gt;
- &lt;strong&gt;I went to a party dressed like a girl.&lt;/strong&gt; Ok, no games, right?! It was intentional. My girlfriend and I were invited to a party where women needed to go dressed like guys and guys like womens. My gf took more than 5h &quot;preparing&quot; me to go to the party... a blonde wig, maquillage, mini-skirt, top, bra with silicone, etc. And now I don&#039;t get angry when she takes forever to be ready.... lol&lt;br /&gt;
&lt;br /&gt;
- &lt;strong&gt;My first nickname on internet was Yakko.&lt;/strong&gt; No appearent reason, I was a fan of Animaniacs and decided to use it everywhere... when I was 15 I switched to my real name and never changed again.&lt;br /&gt;
&lt;br /&gt;
- &lt;strong&gt;My middle name is &quot;Augusto&quot;.&lt;/strong&gt; But you never heard that... and will never hear again, ok?! I hate it, honestly.&lt;br /&gt;
&lt;br /&gt;
- &lt;strong&gt;Most of my life I lived on my family&#039;s farm.&lt;/strong&gt; I know everything you can imagine about country. I enjoy country music, know how to take milk from cows, love to fish, organized challenges between scorpions and spiders until one of them die, etc.&lt;br /&gt;
&lt;br /&gt;
- &lt;strong&gt;I drink TOO MUCH beer.&lt;/strong&gt; Andrei is the proof of concept. Drinking from morning to evening with not stopping is awesome!&lt;br /&gt;
&lt;br /&gt;
- &lt;strong&gt;I forget a lot of things that I need to do.&lt;/strong&gt; I think I have Alzheimer. Just an example... I should have left the DVD I rent, but I went to São Paulo to work (just 240km) today and I forgot to leave the DVD... now it&#039;s in my car and I need to send through postal to someone to leave it there.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And now it&#039;s my turn to choose the next 7 victims:&lt;br /&gt;
- &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/blog.thepimp.net/&#039;);&quot;  href=&quot;http://blog.thepimp.net/&quot;&gt;Pierre-Alain Joye&lt;/a&gt; - PHP Windows JEDI&lt;br /&gt;
- Felipe Pena - PHP Core and an old friend&lt;br /&gt;
- Hannes Magnusson - Another PHP Windows JEDI (ok, just CHM!)&lt;br /&gt;
- &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.jwage.com&#039;);&quot;  href=&quot;http://www.jwage.com&quot;&gt;Jonathan Wage&lt;/a&gt; - Co-worker at Doctrine&lt;br /&gt;
- &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/erik.eae.net&#039;);&quot;  href=&quot;http://erik.eae.net&quot;&gt;Erik Arvidsson&lt;/a&gt; - &quot;The Oracle&quot; of JavaScript&lt;br /&gt;
- &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.forgetfoo.com&#039;);&quot;  href=&quot;http://www.forgetfoo.com&quot;&gt;Jerod Huseman&lt;/a&gt; - Foo guy&lt;br /&gt;
- &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.vedovelli.com.br&#039;);&quot;  href=&quot;http://www.vedovelli.com.br&quot;&gt;Fabio Vedovelli&lt;/a&gt; - One of the most expert Flex guys in Brazil 
    </description>

    <dc:publisher>Bisna Blog</dc:publisher>
    <dc:creator>nospam@example.com (Guilherme Blanco)</dc:creator>
    <dc:subject>
    </dc:subject>
    <dc:date>2009-01-05T12:12:41Z</dc:date>
    <wfw:comment>http://blog.bisna.com/wfwcomment.php?cid=4</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://blog.bisna.com/rss.php?version=1.0&amp;type=comments&amp;cid=4</wfw:commentRss>
    
    
</item>
<item rdf:about="http://blog.bisna.com/index.php?/archives/3.html">
    <title>Dynamic Events in Flex</title>
    <link>http://blog.bisna.com/index.php?/archives/Dynamic-Events-in-Flex.html</link>
    <description>
    In my vast 2 months experience with Flex, I found myself doing stupid things a lot of times.&lt;br /&gt;
&lt;br /&gt;
One of them is creating a new Event subclass every time I need a custom property. So, I created AuthorizeEvent, ServiceEvent, FormEvent, etc.&lt;br /&gt;
I did this until I found DynamicEvent. DynamicEvent is a class derived from Event that accepts to create properties inside of it dynamically.&lt;br /&gt;
&lt;br /&gt;
So, instead of do: &lt;br /&gt;
&lt;div class=&quot;actionscript&quot; style=&quot;text-align: left&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; AuthorizeEvent&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;AuthorizeEvent.&lt;span style=&quot;color: #006600;&quot;&gt;AUTHORIZED&lt;/span&gt;, user&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
I started to do:&lt;br /&gt;
&lt;div class=&quot;actionscript&quot; style=&quot;text-align: left&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;var&lt;/span&gt; &lt;span style=&quot;color: #0066CC;&quot;&gt;e&lt;/span&gt;:DynamicEvent = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; DynamicEvent&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;AuthorizeEvent.&lt;span style=&quot;color: #006600;&quot;&gt;AUTHORIZED&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #0066CC;&quot;&gt;e&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;user&lt;/span&gt; = user;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
Sounds cool, but I still rely on AuthorizeEvent. Just for a naming convention?!&lt;br /&gt;
I know this is bad, but we already have a convention about naming events. So... ChangeXXX or UserXXX.&lt;br /&gt;
&lt;br /&gt;
Since we have a convention, we could simply use the name as strings... so:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;actionscript&quot; style=&quot;text-align: left&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;var&lt;/span&gt; &lt;span style=&quot;color: #0066CC;&quot;&gt;e&lt;/span&gt;:DynamicEvent = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; DynamicEvent&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;UserAuthorized&quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #0066CC;&quot;&gt;e&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;user&lt;/span&gt; = user;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
Now, we decided to create a custom class, basically to encapsulate things that we may need in the future. So, our final class became core.events.DynEvent.&lt;br /&gt;
Here is the base implementation:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;actionscript&quot; style=&quot;text-align: left&quot;&gt;&lt;br /&gt;package core.&lt;span style=&quot;color: #006600;&quot;&gt;events&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0066CC;&quot;&gt;import&lt;/span&gt; mx.&lt;span style=&quot;color: #006600;&quot;&gt;events&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;DynamicEvent&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0066CC;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0066CC;&quot;&gt;dynamic&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt; DynEvent &lt;span style=&quot;color: #0066CC;&quot;&gt;extends&lt;/span&gt; DynamicEvent&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0066CC;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; DynEvent&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0066CC;&quot;&gt;type&lt;/span&gt;:&lt;span style=&quot;color: #0066CC;&quot;&gt;String&lt;/span&gt;, bubbles:&lt;span style=&quot;color: #0066CC;&quot;&gt;Boolean&lt;/span&gt;=&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;false&lt;/span&gt;, cancelable:&lt;span style=&quot;color: #0066CC;&quot;&gt;Boolean&lt;/span&gt;=&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0066CC;&quot;&gt;super&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0066CC;&quot;&gt;type&lt;/span&gt;, bubbles, cancelable&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
I hope this helps everyone that is looking for something like that. 
    </description>

    <dc:publisher>Bisna Blog</dc:publisher>
    <dc:creator>nospam@example.com (Guilherme Blanco)</dc:creator>
    <dc:subject>
    Flex, </dc:subject>
    <dc:date>2008-07-18T17:36:10Z</dc:date>
    <wfw:comment>http://blog.bisna.com/wfwcomment.php?cid=3</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://blog.bisna.com/rss.php?version=1.0&amp;type=comments&amp;cid=3</wfw:commentRss>
    
    
</item>
<item rdf:about="http://blog.bisna.com/index.php?/archives/2.html">
    <title>Castings of DataProvider in Flex</title>
    <link>http://blog.bisna.com/index.php?/archives/Castings-of-DataProvider-in-Flex.html</link>
    <description>
    First real post here, and it&#039;s not a SO difficult thing, but it deserves a post. It&#039;ll also be used as an experiment to see how GeSHi plugin of Serendipity works.&lt;br /&gt;
&lt;br /&gt;
I work in project here where I&#039;m building a prototype using Flex + Symfony + Doctrine. &lt;br /&gt;
My scenario: I had to populate a combobox component from an XML provided by server. The XML format is this:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;xml&quot; style=&quot;text-align: left&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;&lt;/span&gt;?xml &lt;span style=&quot;color: #000066;&quot;&gt;version&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;1.0&quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;encoding&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;utf-8&quot;&lt;/span&gt;?&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;response&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;status&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;OK&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/status&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;message&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;data&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;item&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;id&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;1&quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;label&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;Foo&quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;item&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;id&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;2&quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;label&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;Bar&quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;item&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;id&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;3&quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;label&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;Baz&quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/data&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/response&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
I have a wrapper to HTTPService which handles for non-status OK and Alerts the message. If it&#039;s ok, call result as it should. So, my interested data is everything under &quot;data&quot; node.&lt;br /&gt;
&lt;br /&gt;
I wrote then a simple combo component to handle my wish:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;xml&quot; style=&quot;text-align: left&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;&lt;/span&gt;?xml &lt;span style=&quot;color: #000066;&quot;&gt;version&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;1.0&quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;encoding&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;utf-8&quot;&lt;/span&gt;?&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;mx&lt;/span&gt;:ComboBox xmlns:&lt;span style=&quot;color: #000066;&quot;&gt;mx&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;http://www.adobe.com/2006/mxml&quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;labelField&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;@label&quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;dataProvider&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;{itemService.lastResult.data.item}&quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;creationComplete&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;itemService.send()&quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;mx&lt;/span&gt;:HTTPService &lt;span style=&quot;color: #000066;&quot;&gt;id&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;itemService&quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;method&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;POST&quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;url&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;module/action&quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;useProxy&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;false&quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;resultFormat&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;e4x&quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/mx&lt;/span&gt;:ComboBox&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
With all the Flex magic, it worked well, but 2 warnings in Builder console started to drive me crazy. Those were the warnings:&lt;br /&gt;
&lt;br /&gt;
warning: unable to bind to property &#039;data&#039; on class &#039;XML&#039; (class is not an IEventDispatcher) &lt;br /&gt;
warning: unable to bind to property &#039;item&#039; on class &#039;XMLList&#039; (class is not an IEventDispatcher)&lt;br /&gt;
&lt;br /&gt;
I tried to place under a result event, with warning still flashing me. After a lot of research, I found that was because of lack of castings. Then I started a furious write-and-try to get rid of it.&lt;br /&gt;
After a hundred tries, I found my solution. Here it is:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;actionscript&quot; style=&quot;text-align: left&quot;&gt;&lt;br /&gt;dataProvider=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;{XMLList(XMLList(XML(itemService.lastResult).data)[0].item)}&quot;&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
I know, it&#039;s ugly.... but it works.&lt;br /&gt;
On IRC (irc.freenode.net channel #flex) one user told me I was probably driving compiler crazy. I don&#039;t think so, because the performance increased quite a bit.&lt;br /&gt;
&lt;br /&gt;
Let me explain what I found as how compiler understands it.&lt;br /&gt;
&lt;br /&gt;
itemService.lastResult always return the XML response. It&#039;s not a XMLListCollection, so don&#039;t even try to change that.&lt;br /&gt;
This cast was necessary because you cannot cast to an XMLList without previously casting an XML. I tried to cast &quot;data&quot; as XML, but it told me I could not cast an unknown variable that could not be an XML. So I casted the lastResult as the XML, then I tried to cast &quot;data&quot; as XML too, and compiler gave me another warning, telling I was trying to cast an XMLList into an XML. That was easy... I casted to an XMLList then and retrieved the 0 index. The last thing remaining was the XMLList casting of items... I tried to follow Adobe&#039;s recommendation (always use XMLListCollection as dataProvider), but didn&#039;t work either.&lt;br /&gt;
&lt;br /&gt;
So, if you experience the same thing, feel free to do the same thing I&#039;ve done. Most people usually return the response directly, like:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;xml&quot; style=&quot;text-align: left&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;&lt;/span&gt;?xml &lt;span style=&quot;color: #000066;&quot;&gt;version&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;1.0&quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;encoding&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;utf-8&quot;&lt;/span&gt;?&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;response&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;item&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;id&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;1&quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;label&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;Foo&quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;item&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;id&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;2&quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;label&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;Bar&quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;item&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;id&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;3&quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;label&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;Baz&quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/response&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
For you guys, you&#039;ll never need my &quot;hack&quot;. If you use this approach, itemService.lastResult is already an XML, and the following children will be always treated as XMLList. &lt;br /&gt;
BBBUUUTTT.... if you want to help compiler, do:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;actionscript&quot; style=&quot;text-align: left&quot;&gt;&lt;br /&gt;dataProvider=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;{XMLList(XML(itemService.lastResult).item)}&quot;&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That&#039;s all folks! 
    </description>

    <dc:publisher>Bisna Blog</dc:publisher>
    <dc:creator>nospam@example.com (Guilherme Blanco)</dc:creator>
    <dc:subject>
    Flex, </dc:subject>
    <dc:date>2008-06-21T18:13:59Z</dc:date>
    <wfw:comment>http://blog.bisna.com/wfwcomment.php?cid=2</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://blog.bisna.com/rss.php?version=1.0&amp;type=comments&amp;cid=2</wfw:commentRss>
    
    
</item>
<item rdf:about="http://blog.bisna.com/index.php?/archives/1.html">
    <title>Welcome!</title>
    <link>http://blog.bisna.com/index.php?/archives/Welcome!.html</link>
    <description>
    After exactly two years I decided to revamp my web blog.&lt;br /&gt;
&lt;br /&gt;
For those that didn&#039;t even remember my name, Guilherme Blanco. I live in Brazil and I work for my own company called Bisna.&lt;br /&gt;
&lt;br /&gt;
I spent these years learning new languages and specializing myself into my known languages too.&lt;br /&gt;
As a result, today I am:&lt;br /&gt;
&lt;br /&gt;
- Core developer of &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.phpdoctrine.org&#039;);&quot;  href=&quot;http://www.phpdoctrine.org&quot; title=&quot;Doctrine ORM for PHP&quot;&gt;Doctrine project&lt;/a&gt;&lt;br /&gt;
- Commiter of &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.symfony-project.org&#039;);&quot;  href=&quot;http://www.symfony-project.org&quot; title=&quot;Symfony PHP Framework&quot;&gt;Symfony project&lt;/a&gt;&lt;br /&gt;
- Beta tester of &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.bindows.net&#039;);&quot;  href=&quot;http://www.bindows.net&quot; title=&quot;Bindows AJAX Framework&quot;&gt;Bindows&lt;/a&gt;, aswell as bug fixer too&lt;br /&gt;
- User of &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.adobe.com/products/flex&#039;);&quot;  href=&quot;http://www.adobe.com/products/flex&quot; title=&quot;Adobe Flex&quot;&gt;Adobe Flex&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
I learned a bit of Linux too, and currently I use &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.kubuntu.org&#039;);&quot;  href=&quot;http://www.kubuntu.org&quot; title=&quot;Kubuntu&quot;&gt;Kubuntu 8.04&lt;/a&gt; as my default OS.&lt;br /&gt;
&lt;br /&gt;
What do I expect for my future? Besides conquer the world, nothing else.&lt;br /&gt;
And what do I expect from you? Well, actually I wish to enjoy my website, come back and recommend it!&lt;br /&gt;
&lt;br /&gt;
What do I offer? The experience I&#039;ve had with all these technology I have worked.&lt;br /&gt;
&lt;br /&gt;
I hope you enjoy it! Ah... and welcome! =) 
    </description>

    <dc:publisher>Bisna Blog</dc:publisher>
    <dc:creator>nospam@example.com (Guilherme Blanco)</dc:creator>
    <dc:subject>
    </dc:subject>
    <dc:date>2008-06-19T03:36:23Z</dc:date>
    <wfw:comment>http://blog.bisna.com/wfwcomment.php?cid=1</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://blog.bisna.com/rss.php?version=1.0&amp;type=comments&amp;cid=1</wfw:commentRss>
    
    
</item>

</rdf:RDF>
