problem about doctrine-odm-Collection of common programming errors


  • jini
    php mongodb symfony1 doctrine-odm
    I have a User document that needs to have multiple pictures for that document using GridFS. I am unable to save the files using GridFS.Here is my User Document:namespace Main\UserBundle\Document;use Doctrine\ODM\MongoDB\Mapping\Annotations as MongoDB;/***@MongoDB\Document(db=”mydb”, collection=”users”)*/ class User {/*** @MongoDB\Id*/protected $id;/** @MongoDB\EmbedMany(targetDocument=”Asset”) */public $assets = array();public function __construct(){$this->assets = new \Doctrine\Common\Collec

  • Bryan M.
    php doctrine-odm
    I keep getting this error:PHP Fatal error: Uncaught exception’Doctrine\Common\Annotations\AnnotationException’ with message'[Semantical Error] The annotation “@Document” in classDocuments\Translation was never imported.’ in/home/bmay/devel/svn/wwv/trunk/test_mongo_record/doctrine-mongodb-odm/lib/vendor/doctrine-mongodb-odm/lib/vendor/doctrine-common/lib/Doctrine/Common/Annotations/AnnotationException.php:52Code is simple here:namespace Documents;/** @Document */ class Translation {//private $st

  • Phil Moorhouse
    rest doctrine-odm symfony-2.1
    I’m writing a Symfony2 app that allows mobile users to create and update “Homes” via a REST service. I’m using MongoDB as the storage layer and Doctrine MongoDB ODM to do the Document handling.The GET /homes/{key} and POST /homes methods are working fine. The problem comes when I attempt to update an existing Home with PUT /homes/{key}.Here’s the current code:/*** PUT /homes/{key}** Updates an existing Home.** @param Request $request* @param string $key* @return Response* @throws HttpException*/

  • Ville Mattila
    doctrine2 doctrine-odm
    I have created an inherited document class, see the code below. The documents persists fine but when fetching the document and trying to call the children’s function, I will get an error Call to undefined method Proxies__CG__\Acme\ProductBundle\Document\ProductBase::getPriceDefinition() even the child document has getPriceDefinition() function. The proxy points also to the ProductBase, not SimpleProduct.The parent class, ProductBase.php<?php namespace Acme\ProductBundle\Document;use Doctrine\

  • Juan Sosa
    symfony2 doctrine-odm
    I try to execute this query$em->createQuery(‘select i from AcmePublicBundle:Public i where i.user in (:opc)’); $query->setParameter(‘opc’, $opc);where :opc is an array like this $opc={array}[2]0 = {array}[1]id = “9”1 = {array}[1] id = “10” I get this errorNotice: Undefined offset: 0 in…If I try this $em->createQuery(‘select i from AcmePublicBundle:Public i where i.usuario in (9, 10)’);everything is fine. But I have to pass $opc.Any ideas?

  • dextervip
    doctrine doctrine2 doctrine-odm
    I am trying to setup a zf1 + doctrine mongo odm 1.0.0BETA4-DEV project. I am using https://github.com/Bittarman/zf-d2-odm branch but when I update doctrine version from 1.0.0BETA3 to 1.0.0BETA4-DEV, I get the following error:SCREAM: Error suppression ignored for( ! ) Fatal error: Call to undefined method Doctrine\Common\Annotations\AnnotationReader::setDefaultAnnotationNamespace() in C:\htdocs\zf-d2-odm\library\Lupi\Resource\Odm.php on line 34Call Stack# Time Memory Function Location1 0

  • Chris Travers
    php doctrine doctrine-odm doctrine-query
    i’ m trying to setting up CodeIgniter – Doctrine with Postgresql database. I’ve changed the $db[‘default’][‘dbdriver’] to ‘pgsql’, following the instructions at http://www.phpandstuff.com/articles/codeigniter-doctrine-from-scratch-day-1-install-and-setup but i have an issue, the message i get is: Fatal error: Uncaught exception ‘Doctrine_Record_UnknownPropertyException’ with message ‘Unknown record property / related component “example” on “Airports”‘ in C:\wamp\www\ci_doctrine_day1\system\app

Originally posted 2013-11-27 12:28:52.