Issues

ZF2-263: Zend\Db Cannot use Expression in insert()

Issue Type: Bug Created: 2012-04-12T13:51:47.000+0000 Last Updated: 2012-06-25T22:03:16.000+0000 Status: Resolved Fix version(s): Reporter: Martin Hujer (mhujer) Assignee: Ralph Schindler (ralph) Tags: - Zend\Db

Related issues: Attachments:

Description

<pre class="highlight">
$this->insert(
    array(
        'article_id' => (int) $articleId,
        'name' => $name,
        'email' => $email,
        'text' => $text,
        'commented_on' => new Expression('NOW()'),
    )
);

Expected result: Insert current datetime to DB Actual result: Catchable fatal error: Object of class Zend\Db\Sql\Predicate\Expression could not be converted to string in I:\xampp\zf2\library\Zend\Db\Adapter\Driver\Pdo\Statement.php on line 255

Another occurence http://zend-framework-community.634137.n4.nabble.com/…

Comments

Posted by Evan Coury (evan.pro) on 2012-06-25T22:03:16.000+0000

Resolved with https://github.com/zendframework/zf2/pull/1561

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts