<!-- 
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Tue May 21 16:00:41 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/si/jira.issueviews:issue-xml/DDC-1144/DDC-1144.xml?field=key&field=summary
-->
<rss version="0.92" >
<channel>
    <title>Doctrine Project</title>
    <link>http://www.doctrine-project.org/jira</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>5.2.7</version>
        <build-number>850</build-number>
        <build-date>21-02-2013</build-date>
    </build-info>

<item>
            <title>[DDC-1144] How insert a AES_ENCRYPT value in a table field</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1144</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Hi there,&lt;br/&gt;
I&apos;m trying to insert an encrypted data:&lt;/p&gt;

&lt;p&gt;Because &apos;&quot;INSERT statements are not allowed in DQL, ....&quot; i processed like this:&lt;br/&gt;
&amp;lt;?php&lt;br/&gt;
...&lt;br/&gt;
// controller&lt;br/&gt;
$membre = new \Entity\TMembre();&lt;br/&gt;
$membre-&amp;gt;setPassword($password);&lt;br/&gt;
$em-&amp;gt;persist($membre);&lt;br/&gt;
$em-&amp;gt;flush();&lt;br/&gt;
...&lt;br/&gt;
?&amp;gt;&lt;br/&gt;
//entity&lt;br/&gt;
&amp;lt;?php&lt;br/&gt;
namespace Entity;&lt;br/&gt;
/**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;TMembre&lt;br/&gt;
 *&lt;/li&gt;
	&lt;li&gt;@Table(name=&quot;t_membre&quot;)&lt;/li&gt;
	&lt;li&gt;@Entity(repositoryClass=&quot;Repository\TMembreRepository&quot;)&lt;br/&gt;
 */&lt;br/&gt;
class TMembre&lt;br/&gt;
{&lt;br/&gt;
    /**&lt;/li&gt;
	&lt;li&gt;Set password     *&lt;/li&gt;
	&lt;li&gt;@param string $password     */&lt;br/&gt;
    public function setPassword($password)
    {
    	$this-&amp;gt;email = &quot;AES_ENCRYPT(&apos;&quot;.$email.&quot;&apos;,&apos;&quot;._MYSQL_CRYPT.&quot;&apos;)&quot;; =&amp;gt; insert this entire string without executing encryption
    	$this-&amp;gt;email = new \Doctrine\ORM\Query\Expr\Func(&quot;AES_ENCRYPT&quot;,array(&quot;&apos;&quot;.$email.&quot;&apos;&quot;,&quot;&apos;&quot;._MYSQL_CRYPT.&quot;&apos;&quot;)); =&amp;gt; does not work
    }
&lt;p&gt;}&lt;br/&gt;
?&amp;gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;How can i do ?&lt;br/&gt;
Add this method to Doctrine\ORM\Query\Expr class ?&lt;/p&gt;

&lt;p&gt;/**&lt;br/&gt;
    public function aesEncrypt($value)&lt;/p&gt;
    {
       return &quot;AES_ENCRYPT(&apos;&quot;.$value.&quot;&apos;,&apos;&quot;._MYSQL_CRYPT.&quot;&apos;)&quot;
    }

&lt;p&gt;Best regards&lt;/p&gt;

&lt;p&gt;David&lt;/p&gt;</description>
                <environment>Win XP, MySql5, Php5.3, ZendFramework 1.11.4</environment>
            <key id="12626">DDC-1144</key>
            <summary>How insert a AES_ENCRYPT value in a table field</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="dquintard">dquintard</reporter>
                        <labels>
                    </labels>
                <created>Tue, 10 May 2011 19:58:28 +0000</created>
                <updated>Tue, 10 May 2011 19:58:28 +0000</updated>
                                    <version>2.0.4</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>