Skip to end of metadata
Go to start of metadata

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[]]></ac:plain-text-body></ac:macro>

<p><ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[]]></ac:plain-text-body></ac:macro> <strong>Where is Zend Framework's ORM implementation?</strong></p>
<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[]></ac:plain-text-body></ac:macro>
<p>Object Relational Maps (ORMs) are practically frameworks on their own, and consist of data access, repositories, identity maps, and many more components. We feel it makes sense to let ORM experts write such software, and allow integrating these solutions in Zend Framework. Popular projects include <a href="http://doctrine-project.org/">Doctrine</a> and <a href="http://www.propelorm.org/">Propel</a>. </p>
<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[]
]></ac:plain-text-body></ac:macro>

<p><ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[]]></ac:plain-text-body></ac:macro> <strong>I want to use a SQL function or perform calculations in a statement I'm generating with Zend_Db_Select. How can I do this?</strong></p>
<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[]></ac:plain-text-body></ac:macro>
<p>Actually, by default, if your expression includes parentheses, <code>Zend_Db_Select</code> will cast the statement appopriately. However, if it does not, or you are having problems, you can use <code>Zend_Db_Expr</code> to explicitly create the expression:</p>

<ac:macro ac:name="code"><ac:default-parameter>php</ac:default-parameter><ac:plain-text-body><![CDATA[
/* Build the SQL:

  • SELECT p."product_id", p.cost * 1.08 AS cost_plus_tax
  • FROM "products" AS p
    */
    $select = $db->select()
    ->from(array('p' => 'products'),
    array(
    'product_id',
    'cost_plus_tax' => new Zend_Db_Expr('p.cost * 1.08'),
    ));
    ]]></ac:plain-text-body></ac:macro>
    <ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[]]></ac:plain-text-body></ac:macro>
Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.