Questions tagged [doctrine-odm]

Doctrine Object Document Mapper is built for PHP 5.3.2+ and provides transparent persistence between PHP objects and data stores such as MongoDB, CouchDB, OrientDB, and PHPCR.

Doctrine Object Document Mapper is built for PHP 5.3.2+ and provides transparent persistence between PHP objects and data stores such as MongoDB, CouchDB, OrientDB, and PHPCR.

Related links

538 questions
0
votes
1 answer

Unable to break up a Doctrine ODM Query

SO I have the following Mongo ODM query that works just fine: $query = $dm->createQueryBuilder('MainClassifiedBundle:Listing') ->select('id', 'title', 'assets') ->field('somefield0')->equals($somefield) …
Strong Like Bull
  • 11,155
  • 36
  • 98
  • 169
0
votes
1 answer

Doctrine Mongo ODM reference 3 collections

Hi I'm trying to reference 3 collections but i fail fom 2 > 3 referencing, let me explain what i'm trying to do. I have User class that have reference posts referenceMany > Posts and in posts i have referenceMany > comments. Note: Doctrine Mongo ODM…
Emrah Mehmedov
  • 1,492
  • 13
  • 28
0
votes
1 answer

Can there be an issue if Mongo class is instanced twice?

I want to use MongoDB for storing sessions, and I need to inject the \Mongo object into the session handler. I first thought I could fetch it from doctrine with something like this: services: mongo.connection: class:…
ChocoDeveloper
  • 14,160
  • 26
  • 79
  • 117
0
votes
1 answer

Doctronie 2 ODM MongoDB Sort in Annotations

I try to sort my query directly with annotations as it is done by ORM with MongoDB. /** * @ORM\OrderBy({"position" = "ASC"}) */ I use a @MongoDB\ReferenceMany: class page{ /** * @MongoDB\ReferenceMany( * …
vinzcoco
  • 89
  • 1
  • 9
0
votes
2 answers

Domain object design for dynamic organization staff

I have a base entity "Organization" that represents an organization (be it a business entity, a baseball team, or a podcast). It is quite generic. Each of these organizations can have multiple staff, and each staff can be of a different type. We…
0
votes
1 answer

Retrieve parent document with a doctrine2 or mongodb query

I am using Symfony 2.1 and Doctrine - MongoDBBundle. I have three documents. The first is a company, which I call "Institution". The second are contacts inside the institution, and the third are the talks the user had with the contact. Contact and…
Julien Fastré
  • 1,008
  • 13
  • 20
0
votes
1 answer

Binding parameters with Doctrine ODM (MongoDB)

Is there a way to bind parameters during a Doctrine ODM MongoDB query? $path = $this->objectManager->getRepository("MyBundle:MyDocument") ->findOneBy(array("slug" => new MongoRegex("/^slug/"))) ; This would be instead of having to do string…
Alexander Trauzzi
  • 7,277
  • 13
  • 68
  • 112
0
votes
2 answers

example working config for Doctrine ODM zf2 Module?

can anyone please provide an example of driver configuration for reading annotation of documents in Application/src/Application/Document/.... created this but still doctrine-module odm:schema:create said all collection created but there is no…
Sina Miandashti
  • 2,087
  • 1
  • 26
  • 40
0
votes
2 answers

Adding and removing elements from doctrine mongodb ODM results - PHP

How do you remove and add elements to results returned by doctrine's odm. For example, I have the query $fruits = $dm->createQueryBuilder('Fruits') ->field('id')->in($fruit_list) ->getQuery()->execute(); $fruits returned…
Bhavya Agarwal
  • 107
  • 1
  • 11
0
votes
1 answer

Why Doctrine2 ODM's results of findBy() and createQueryBuilder()->getQuery()->execute() differ from each other?

I have tried two different ways to do the same query with Doctrine's MongoDB-ODM. Can you figure out that why the two, in my opinion similar queries both return different result? Snippet 1 doesn't return anything where Snippet 2 returns correct…
Ville Mattila
  • 1,343
  • 3
  • 15
  • 28
0
votes
1 answer

Can't find gedmo annotation in ZF2 RC for Doctrine 2 Mongo ODM

I've been trying to use the gedmo sluggable behavior for Doctrine2 on a ZF2 RC2 application using MongoDB but always end up with an error saying that Doctrine can't find the annotation even though its listener has suscribed to the event manager in…
jhuet
  • 396
  • 2
  • 11
0
votes
0 answers

How to work with DateTime with doctrine MongoDB ODM

I've always used "date" and "timestamp" types in my mapping and then dealt with DateTime's everywhere in the objects. Suddenly I'm getting MongoDate and MongoTimestamp objects. Is this a purposeful change or a bug? Running latest symfony and…
MDrollette
  • 6,887
  • 1
  • 36
  • 49
0
votes
1 answer

Why a function call in Doctrine's proxy object points to parent object instead of inherited child object?

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…
Ville Mattila
  • 1,343
  • 3
  • 15
  • 28
0
votes
1 answer

Doctrine2 ODM QueryBuilder - Update field with sum of two fields

Basically try to do the same as: UPDATE table SET column3 = column1 + column2; In the Doctrine2's ODM QueryBuilder - is something like this possible with out MapReduce? I have a sharded collection, so I need to use the QueryBuilder in order to…
kmfk
  • 3,821
  • 2
  • 22
  • 32
0
votes
2 answers

ZF1 + Doctrine 2 ODM: Call to undefined method AnnotationReader::setDefaultAnnotationNamespace

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…
dextervip
  • 4,999
  • 16
  • 65
  • 93
1 2 3
35
36