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
5
votes
3 answers

Zend Framework 2 + Doctrine ODM, "The Class was not found in the chain configured namespaces" error?

When setting up ZF2 + ODM, I'm getting the following error: The class 'Application\Document\User' was not found in the chain configured namespaces The current setup is as the following: ZF2 stable, installed doctrine ODM via composer.phar with…
Wisu Suntoyo
  • 158
  • 1
  • 2
  • 7
5
votes
1 answer

Doctrine MongoDB result caching

How would one go about caching Doctrine MongoDB results? Looking at the code for Configuration it doesn't appear to have a built in result cache like standard Doctrine, only a query cache. I have thought of creating my own cache layer in the app but…
Mathew Attlee
  • 549
  • 1
  • 4
  • 15
5
votes
3 answers

How to suppress a MongoDDException when proxy can't find a referenced document

We are using Symfony2/DoctrineOdm/MongoDB and when we do: if ($doc.referenceOne != null) { ... } and the $doc.referenceOne contains a MongoDbRef that point to a deleted/lost document, the Doctrine Proxy object raises a MongoDBException. It is…
Madarco
  • 2,084
  • 18
  • 26
5
votes
1 answer

Doctrine ODM MongoDB - Replicate a simple One to Many Reference with Constraint

I'm new to Doctrine, mongo and the ODM setup and while playing with this setup in ZF1 I'm trying to replicate a simple one to many reference with a constraint. Here is the situation and would like some advise on how to achieve this. This is a…
4
votes
1 answer

Which MongoDB library to use for a stand-alone PHP project with Symfony?

I am leading a new project where we're convinced that MongoDB is the right choice for database. We have decided that the architecture would be SOA, so the web part will be developed using Symfony and the service part will be developed using…
Mohammad Emran
  • 872
  • 4
  • 14
4
votes
2 answers

Doctrine Mongodb ODM and DateTime query

I could use some help on this problem. I'm creating an application using Symfony2 + mongodb + doctrine. I just want to use Doctrine ODM to query all the users who have been logged in the last 5 minutes. I have a User collection with a date field…
JuCachalot
  • 1,010
  • 4
  • 15
  • 27
4
votes
1 answer

Doctrine ODM / MongoDB: How to query for references within embedded documents?

I'm new to Doctrine ODM and i'm totally stuck with a simple query :( Let me start with the document structure: Array ( [_id] => 4ee1e4527f749c9411000012 [voteList] => Array ( [_id] => 4ee1e4527f749c9411000013 [votes] => Array …
Eugene
  • 356
  • 3
  • 14
4
votes
1 answer

Why does composer complain about the ext-mongo extension?

When I try to install doctrine/mongodb-odm-bundle and doctrine/mongodb with composer it throws an error. composer require doctrine/mongodb-odm-bundle doctrine/mongodb Using version ^3.5 for doctrine/mongodb-odm-bundle Using version ^1.6 for…
JoeriV
  • 357
  • 2
  • 9
4
votes
2 answers

loading of related documents in doctrine ODM leads to too many queries

I'm stuck trying to reduce the number of database queries on a web api. My database has 3 collections : playground, widget, token One playground has many widgets, one widget has one token. Each relationship uses referencesOne/referenceMany. So here…
ᴄʀᴏᴢᴇᴛ
  • 2,939
  • 26
  • 44
4
votes
4 answers

Class XXX is not a valid document or mapped super class

I'm using doctrine Doctrine MongoDB ODM 1.0.3. When trying to update document using doctrine I'm getting the following error: Class XXX is not a valid document or mapped super class. I have the following class for the document:
King Julien
  • 10,981
  • 24
  • 94
  • 132
4
votes
1 answer

Doctrine MongoDB geoNear() dinstance set to 0 when adding additional query

I'm using a geoNear() to calculate distances between objects in my Mongo database. The query works perfectly, even with addition field filters such as ->field('name')->equals($name) etc... This automatically populates a mapped field @ODM\Distance on…
Simon
  • 1,643
  • 7
  • 30
  • 61
4
votes
2 answers

Implement a State Pattern with Doctrine ORM

I have a class that is using the State pattern. Here's a simple example /** * @Enitity **/ class Door { protected $id; protected $state; public function __construct($id, DoorState $state) public function setState(DoorState $state) { …
Clutch
  • 7,404
  • 11
  • 45
  • 56
4
votes
1 answer

Doctrine2 MongoDB ODM Compound Key (UniqueEntity)

I'm having trouble implementing something in Zf2 and Doctrine2 using MongoDB that's fairly straightforward in Symfony2 and Doctrine2. I have an Invoice Document where I want to make sure the combination of the Invoice::pattern and Invoice::number is…
Simon
  • 1,643
  • 7
  • 30
  • 61
4
votes
1 answer

Bind the doctrine ORM entity and doctrine ODM document and use it in SonataAdminBundle

I have a User entity and Address document. They are linked between each other with @gedmo\references doctrine extension. This relation works just fine. I can get both referenceMany and referenceOne linked objects. Now i need to use it at the…
ArFeRR
  • 85
  • 1
  • 5
4
votes
2 answers

Native Mongo Query Doctrine ODM

In the doctrine for relational databases we have the QueryBuilder, can manually write DQL queries and if we really must, can use Doctrine's connection to execute raw SQL. I have not found (nor in the API, nor the documentation) a way to do this in…
Quant
  • 350
  • 3
  • 14
1 2
3
35 36