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
51
votes
7 answers

How do I force doctrine to reload the data from the database?

I'm using doctrine/mongodb 1.0.0-BETA1 in a symfony2.1 install. So i'm trying to force my repository to call data from my database instead of using the object it has cached. $audit =…
daSn0wie
  • 879
  • 1
  • 8
  • 15
28
votes
12 answers

Symfony there are no commands defined in the "make" namespace

Following the documentation found here I enter php bin/console make:entity Product in Terminal and get the following error: [Symfony\Component\Console\Exception\CommandNotFoundException] There are no commands defined in the "make" namespace.
lola_the_coding_girl
  • 843
  • 2
  • 10
  • 22
24
votes
0 answers

How to properly handle denormalized data synchronization in Doctrine MongoDB ODM

Denormalization of referenced data seems a pretty common practice when using MongoDB. Yet, I do not see any built-in way to handle that with Doctrine MongoDB ODM. Let's say I have a social network where users can follow each other, here are two…
17
votes
6 answers

Doctrine undefined function apc_fetch

I'm using this tutorial, which gives a detail explanation about how to set up CodeIgniter and Doctrine. I'm using CodeIgniter 2.1.0 and Doctrine 2.2.1, but I get this error: Fatal error: Call to undefined function Doctrine\Common\Cache\apc_fetch()…
H Dindi
  • 1,484
  • 6
  • 39
  • 68
14
votes
3 answers

MongoDB ODM SELECT COUNT(*) equivalent

I wonder if there is an equivalent to the MySQL-Query: SELECT COUNT(*) FROM users in MongoDB ODM? This might work: $qb = $this->dm->createQueryBuilder('Documents\Functional\Users'); $qb->select('id'); $query = $qb->getQuery(); $results =…
chris
  • 1,245
  • 1
  • 10
  • 22
12
votes
3 answers

How can I use regular expressions with Doctrine's Mongodb ODM?

I'm trying to use regular expressions to query Mongodb using Doctrine's Mongodb ODM on Symfony 2. I know the PHP mongo driver can do it. However, I don't know how to do this with Doctrine. Do I use the same class? How do I reference MongoRegex from…
chaostheory
  • 1,621
  • 4
  • 20
  • 36
11
votes
2 answers

Doctrine MongoDB ODM search in two or more fields

I would like to write a query in Doctrine Mongo ODM that searches by regex in two or more fields. In SQL it would look like: SELECT * FROM user WHERE name LIKE %search% OR surname LIKE %search%; I can write a query for one field like…
bazo
  • 745
  • 9
  • 26
8
votes
5 answers

Symfony2 - DoctrineMongoDBBundle - Doctrine\Common\Annotations\AnnotationException

I'm trying to use the DoctrineMongoDBBundle, however, i'm running into an issue. In my config.yml, I have: doctrine_mongodb: connections: default: server: mongodb://localhost:27017 options: …
Flukey
  • 6,445
  • 3
  • 46
  • 71
8
votes
2 answers

How to force a Doctrine MongoDB ODM Document Proxy to convert to the 'original' document?

I have a document Person referenced in document User. When I retrieve User, it doesn't have a Person object embedded, but a Person proxy object. Is there a way to "force" the proxy to become a "full" document (so Person proxy => Person). I've tried…
Teun
  • 81
  • 1
  • 3
8
votes
2 answers

Doctrine ODM OneToOne Bi-Directional Reference using repositoryMethod

How can Doctrine ODM be used to create a one-to-one bi-directional reference that lazy loads while using a field other than the primary key for the reference? I have two collections in MongoDB with documents, Article and ArticleMetaData. For every…
Sander Toonen
  • 3,463
  • 35
  • 54
8
votes
1 answer

JMS Serializer Deserialize with abstract parent class

I have an abstract parent (mapped super-)class which has several children with different properties which I'd like to deserialize. I'm storing the data using MongoDB and Doctrine ODM, so I also have a discriminator field which tells doctrine which…
con
  • 2,358
  • 25
  • 33
7
votes
1 answer

Issue persisting nested nested embedded documents

Update: Pretty certain this a bug, made an issue on Jira: http://bit.ly/gpstW9 Update (5th May 2011): Upon jwage's recommendation I have switch to Referenced relationships between Categories and Post (as opposed to Embdedded). I'm using the latest…
Cobby
  • 5,273
  • 4
  • 28
  • 41
7
votes
3 answers

How to make username case insensitive in zf2

I used zf2 authentication for authenticate user in my project.I saved Harib in my user table as user name but if i use my user name Harib then its accept or if i use harib then its not accept,i want to remove case sensitivity of user name so both…
7
votes
2 answers

Doctrine MongoDB - is there any way to build a query from JSON?

I have an arbitrary MongoDB JSON find query string, for example: { "address.city": "Seattle"} or { qty: { $gt: 5, $lt: 50 } Is there any existing method to create a Doctrine.MongoDB.Query object from the JSON string? Or alternately to query mongo…
tgreiser
  • 393
  • 3
  • 13
7
votes
2 answers

Doctrine2 Entites - Is it possible to compare a "dirty" object to one from the database

Is it possible to compare the state of an entity object between the current "dirty" version (an object that has some of its properties changed, not yet persisted) and the "original" version (the data still in the database). My assumption was that I…
Dave Lancea
  • 1,669
  • 1
  • 16
  • 19
1
2 3
35 36