{"id":1682,"date":"2022-08-30T15:18:34","date_gmt":"2022-08-30T15:18:34","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/27\/problem-about-doctrine-odm-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:18:34","modified_gmt":"2022-08-30T15:18:34","slug":"problem-about-doctrine-odm-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/problem-about-doctrine-odm-collection-of-common-programming-errors\/","title":{"rendered":"problem about doctrine-odm-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/2cbf1f4321b5863af35e1fd634d85506?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\njini<br \/>\nphp mongodb symfony1 doctrine-odm<br \/>\nI 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=&#8221;mydb&#8221;, collection=&#8221;users&#8221;)*\/ class User {\/*** @MongoDB\\Id*\/protected $id;\/** @MongoDB\\EmbedMany(targetDocument=&#8221;Asset&#8221;) *\/public $assets = array();public function __construct(){$this-&gt;assets = new \\Doctrine\\Common\\Collec<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/98afb4911913bbdd02a4a01aa3ed5fab?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nBryan M.<br \/>\nphp doctrine-odm<br \/>\nI keep getting this error:PHP Fatal error: Uncaught exception&#8217;Doctrine\\Common\\Annotations\\AnnotationException&#8217; with message'[Semantical Error] The annotation &#8220;@Document&#8221; in classDocuments\\Translation was never imported.&#8217; 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<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/a9b6f01bfa14f98d246e64262f7190f3?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nPhil Moorhouse<br \/>\nrest doctrine-odm symfony-2.1<br \/>\nI&#8217;m writing a Symfony2 app that allows mobile users to create and update &#8220;Homes&#8221; via a REST service. I&#8217;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&#8217;s the current code:\/*** PUT \/homes\/{key}** Updates an existing Home.** @param Request $request* @param string $key* @return Response* @throws HttpException*\/<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/908f144b7609574bf8063919f61d79af?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nVille Mattila<br \/>\ndoctrine2 doctrine-odm<br \/>\nI 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&#8217;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&lt;?php namespace Acme\\ProductBundle\\Document;use Doctrine\\<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/0ea55df16219cc47311a077b65521804?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nJuan Sosa<br \/>\nsymfony2 doctrine-odm<br \/>\nI try to execute this query$em-&gt;createQuery(&#8216;select i from AcmePublicBundle:Public i where i.user in (:opc)&#8217;); $query-&gt;setParameter(&#8216;opc&#8217;, $opc);where :opc is an array like this $opc={array}[2]0 = {array}[1]id = &#8220;9&#8221;1 = {array}[1] id = &#8220;10&#8221; I get this errorNotice: Undefined offset: 0 in&#8230;If I try this $em-&gt;createQuery(&#8216;select i from AcmePublicBundle:Public i where i.usuario in (9, 10)&#8217;);everything is fine. But I have to pass $opc.Any ideas?<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/586083451a30409a024d015e094075bd?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\ndextervip<br \/>\ndoctrine doctrine2 doctrine-odm<br \/>\nI 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<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/7504b530d1df33b972a3431d3640f618?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nChris Travers<br \/>\nphp doctrine doctrine-odm doctrine-query<br \/>\ni&#8217; m trying to setting up CodeIgniter &#8211; Doctrine with Postgresql database. I&#8217;ve changed the $db[&#8216;default&#8217;][&#8216;dbdriver&#8217;] to &#8216;pgsql&#8217;, 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 &#8216;Doctrine_Record_UnknownPropertyException&#8217; with message &#8216;Unknown record property \/ related component &#8220;example&#8221; on &#8220;Airports&#8221;&#8216; in C:\\wamp\\www\\ci_doctrine_day1\\system\\app<\/li>\n<\/ul>\n<p id=\"rop\"><small>Originally posted 2013-11-27 12:28:52. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>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=&#8221;mydb&#8221;, collection=&#8221;users&#8221;)*\/ class User {\/*** @MongoDB\\Id*\/protected $id;\/** @MongoDB\\EmbedMany(targetDocument=&#8221;Asset&#8221;) *\/public $assets = array();public function __construct(){$this-&gt;assets = new \\Doctrine\\Common\\Collec Bryan [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,1],"tags":[],"class_list":["post-1682","post","type-post","status-publish","format-standard","hentry","category-semantic","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1682","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=1682"}],"version-history":[{"count":1,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1682\/revisions"}],"predecessor-version":[{"id":8807,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1682\/revisions\/8807"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=1682"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=1682"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=1682"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}