Skip to content

Instantly share code, notes, and snippets.

@michellesanver
Created March 20, 2015 09:43

Revisions

  1. michellesanver revised this gist Mar 20, 2015. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions doctrine.php
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,12 @@
    So this is how it looks like in composer, so I do believe I have the latest version:
    //So this is how it looks like in composer, so I do believe I have the latest version:
    "doctrine/orm": "~2.5@dev",
    "doctrine/common": "~2.5@dev",
    "doctrine/dbal": "dev-retry-logic as 2.5",
    "doctrine/doctrine-bundle": "~1.2",
    "doctrine/migrations": "~1.0@dev",
    "doctrine/doctrine-migrations-bundle": "~2.1@dev",

    My issue is with the following code that generates the error Fatal error:
    //My issue is with the following code that generates the error Fatal error:
    Call to undefined method Doctrine\ORM\QueryBuilder::insert()

    <?php
  2. michellesanver created this gist Mar 20, 2015.
    22 changes: 22 additions & 0 deletions doctrine.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    So this is how it looks like in composer, so I do believe I have the latest version:
    "doctrine/orm": "~2.5@dev",
    "doctrine/common": "~2.5@dev",
    "doctrine/dbal": "dev-retry-logic as 2.5",
    "doctrine/doctrine-bundle": "~1.2",
    "doctrine/migrations": "~1.0@dev",
    "doctrine/doctrine-migrations-bundle": "~2.1@dev",

    My issue is with the following code that generates the error Fatal error:
    Call to undefined method Doctrine\ORM\QueryBuilder::insert()

    <?php
    $queryBuilder = $em->createQueryBuilder()
    ->insert('product_browse_view')
    ->values(
    array(
    'productId' => '?',
    )
    )
    ->setParameter(0, $id);

    // Ideas what I am doing wrong is very helpful! Thank you.