<!--
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Sun May 19 09:55:09 UTC 2013

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
For example:
http://www.doctrine-project.org/jira/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?jqlQuery=project+%3D+10032+AND+labels+%3D+MappedSuperclass&tempMax=1000&field=key&field=summary
-->
<!-- If you wish to do custom client-side styling of RSS, uncomment this:
<?xml-stylesheet href="http://www.doctrine-project.org/jira/styles/jiraxml2html.xsl" type="text/xsl"?>
-->
<rss version="0.92">
    <channel>
        <title>Doctrine Project</title>
        <link>http://www.doctrine-project.org/jira/secure/IssueNavigator.jspa?reset=true&amp;jqlQuery=project+%3D+10032+AND+labels+%3D+MappedSuperclass</link>
        <description>An XML representation of a search request</description>
                <language>en-us</language>
                        <issue start="0" end="2" total="2"/>
                <build-info>
            <version>5.2.7</version>
            <build-number>850</build-number>
            <build-date>21-02-2013</build-date>
        </build-info>
<item>
            <title>[DDC-2436] Inheritance on mappedSuperClass</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2436</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Sometimes is necessary some associations(many to many) in the mappedSuperClass. This associations should not be lost (inversedBy side and mappedBy ). The only one way to get this, was to implement an abstract class as Single Inheritance Table and then the mappedSuperClass inherit of this. But this is not optimum, because we are losing the OOP, creating classes which should not exist.&lt;/p&gt;

&lt;p&gt;I realized of this when i was creating my bundle to be used for some projects, but I needed each project could extends from my class and add some properties or methods according their needs.&lt;/p&gt;

&lt;p&gt;This is the link where you can see more details of this:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://stackoverflow.com/questions/16405556/mapped-super-class-symfony2-2&quot; class=&quot;external-link&quot;&gt;http://stackoverflow.com/questions/16405556/mapped-super-class-symfony2-2&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks for your attention.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14842">DDC-2436</key>
            <summary>Inheritance on mappedSuperClass</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="ocramius">Marco Pivetta</assignee>
                                <reporter username="pcastrotigre">Petter Castro</reporter>
                        <labels>
                        <label>mappedsuperclass</label>
                    </labels>
                <created>Wed, 8 May 2013 21:25:43 +0000</created>
                <updated>Fri, 10 May 2013 16:55:33 +0000</updated>
                    <resolved>Fri, 10 May 2013 01:12:25 +0000</resolved>
                                                            <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="20264" author="ocramius" created="Fri, 10 May 2013 01:12:25 +0000"  >&lt;p&gt;Mapped superclasses cannot be referenced as they are only meant to provide some simplification by allowing inherited mappings in child classes.&lt;/p&gt;

&lt;p&gt;If you want to enforce some kind of association in third party libraries, you can define interfaces and reference those: then, with a listener (during the onLoadMetadata event), replace the interfaces in mappings with (configured) concrete class names.&lt;/p&gt;</comment>
                    <comment id="20268" author="pcastrotigre" created="Fri, 10 May 2013 16:08:54 +0000"  >&lt;p&gt;I did it, and everything worked perfectly. However, is there a way to dynamically change the &quot;resolve_target_entities&quot; inside my LoadClassMetadata or inside my php code?. &lt;br/&gt;
I would like the user makes this configurations with params from my bundle. In background, my bundle will configure these params for doctrine.&lt;br/&gt;
Could i do that?&lt;/p&gt;

&lt;p&gt;Thanks again for your attention.&lt;/p&gt;</comment>
                    <comment id="20269" author="pcastrotigre" created="Fri, 10 May 2013 16:25:10 +0000"  >&lt;p&gt;I was thinking in duplicate some code of yours. Exactly this one:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
$def = $container-&amp;gt;findDefinition(&apos;doctrine.orm.listeners.resolve_target_entity&apos;);
foreach ($config[&apos;resolve_target_entities&apos;] as $name =&amp;gt; $implementation) {
     $def-&amp;gt;addMethodCall(&apos;addResolveTargetEntity&apos;, array(
     $name, $implementation, array()
     ));
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="20270" author="ocramius" created="Fri, 10 May 2013 16:42:22 +0000"  >&lt;p&gt;That&apos;s exactly how this has to be done.&lt;/p&gt;</comment>
                    <comment id="20271" author="pcastrotigre" created="Fri, 10 May 2013 16:47:55 +0000"  >&lt;p&gt;I did but there is a problem.... The service doctrine.orm.listeners.resolve_target_entity is not public. So i can&apos;t use it in my bundle. I wouldn&apos;t like to duplicate all code from this Service. How could I do?&lt;/p&gt;</comment>
                    <comment id="20272" author="ocramius" created="Fri, 10 May 2013 16:49:44 +0000"  >&lt;p&gt;That&apos;s an issue for the DoctrineBundle, not for the ORM.&lt;/p&gt;</comment>
                    <comment id="20273" author="pcastrotigre" created="Fri, 10 May 2013 16:55:33 +0000"  >&lt;p&gt;Ok thanks a lot for your help. I will redirect my question to them.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DDC-2157] @HasLifecycleCallbacks does not fire events when set on @MappedSuperclass</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2157</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I am unable to fire any of the &quot;HasLifecycleCallbacks&quot; when defined on a MappedSuperclass... (neither PreUpdate, PostUpdate,PrePersist, PostPersist and others)&lt;/p&gt;

&lt;p&gt;I have even tried to put @ORM\HasLifecycleCallbacks on the child class with onPostRemove() on mapped =&amp;gt; not working anymore&lt;/p&gt;

&lt;p&gt;It only works when i put @ORM\HasLifecycleCallbacks and onPostRemove() both in child class &quot;MyMappedTask&quot;...&lt;/p&gt;

&lt;p&gt;Is this a bug ..?&lt;/p&gt;

&lt;p&gt;To reproduce :&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
&amp;lt;?php
namespace MyProject\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\MappedSuperclass
 * @ORM\HasLifecycleCallbacks
 */
class MyMappedTask
{
   /**
    * @ORM\PreRemove
    * @ORM\PostRemove
    * @ORM\PreUpdate
    * @ORM\PostUpdate
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function onPostRemove()
    {
        echo &lt;span class=&quot;code-quote&quot;&gt;&quot;here is never reached !&quot;&lt;/span&gt;;
    }
}

/**
 * @ORM\Entity(repositoryClass=&lt;span class=&quot;code-quote&quot;&gt;&quot;MyProject\Repository\MyTaskRepository&quot;&lt;/span&gt;)
 * @ORM\Table()
 */
class MyTask &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; MyMappedTask
{

}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>Windows 7 x64 / Apache 2.4.2 / MySQL server 5.1.62</environment>
            <key id="14246">DDC-2157</key>
            <summary>@HasLifecycleCallbacks does not fire events when set on @MappedSuperclass</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="frederes">Frederic</reporter>
                        <labels>
                        <label>HasLifecycleCallbacks</label>
                        <label>MappedSuperclass</label>
                    </labels>
                <created>Tue, 20 Nov 2012 13:59:52 +0000</created>
                <updated>Tue, 27 Nov 2012 21:29:48 +0000</updated>
                    <resolved>Tue, 27 Nov 2012 21:29:48 +0000</resolved>
                            <version>2.2.3</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="19025" author="fabio.bat.silva" created="Thu, 22 Nov 2012 14:40:48 +0000"  >&lt;p&gt;code format&lt;/p&gt;</comment>
                    <comment id="19026" author="fabio.bat.silva" created="Thu, 22 Nov 2012 14:43:33 +0000"  >&lt;p&gt;Hi Frederic,&lt;/p&gt;

&lt;p&gt;It failed for all events or just for @PostRemove ?&lt;/p&gt;

&lt;p&gt;Could you try to add a failing test case ?&lt;/p&gt;

&lt;p&gt;Cheers&lt;/p&gt;</comment>
                    <comment id="19038" author="frederes" created="Fri, 23 Nov 2012 14:35:46 +0000"  >&lt;p&gt;Hi Fabio,&lt;/p&gt;

&lt;p&gt;1) Thank you for the &quot;code&quot; tag, i didn&apos;t know to do &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/wink.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;

&lt;p&gt;2) Is fails with all the Annotations &quot;Pre/Post*&quot; ...&lt;/p&gt;

&lt;p&gt;Did you try this test case ?&lt;/p&gt;

&lt;p&gt;Thank you&lt;/p&gt;</comment>
                    <comment id="19040" author="fabio.bat.silva" created="Fri, 23 Nov 2012 18:40:18 +0000"  >&lt;p&gt;Hi Frederic,&lt;/p&gt;

&lt;p&gt;Can&apos;t reproduce.. &lt;br/&gt;
Could you try to change the attached test case and make it fails ?&lt;/p&gt;


&lt;p&gt;Cheers&lt;/p&gt;</comment>
                    <comment id="19068" author="frederes" created="Tue, 27 Nov 2012 15:44:53 +0000"  >&lt;p&gt;Hi Fabio,&lt;/p&gt;

&lt;p&gt;Thank you for the test case, it is OK !&lt;/p&gt;

&lt;p&gt;I found what the problem was :&lt;br/&gt;
I use Symfony2 and i have one bundle with the @MappedSuperclass entity and its callbacks (@HasLifecycleCallbacks), and another bundle with the child class (@Entity/@Table).&lt;br/&gt;
In that case, you must register the 2 bundles on the mappings (config.yml) otherwise it fails. &lt;br/&gt;
(I only registered the bundle which contains the child class but was not enough for Doctrine to understand...) &lt;/p&gt;

&lt;p&gt;I don&apos;t know if it is a bug on Symfony2, not well documented in this case...&lt;/p&gt;

&lt;p&gt;Thank you for all&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11354" name="DDC2157Test.php" size="3171" author="fabio.bat.silva" created="Fri, 23 Nov 2012 18:30:19 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>