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
1
vote
1 answer

Persisting Updated Objects in Symfony

I have a symfony application where I am attempting to update an entity in the database using a setter. However when I update the entity and call $this->em->flush() the entity is not persisted to the database. Here is my service:
Jake Sylvestre
  • 936
  • 3
  • 14
  • 39
1
vote
3 answers

Can't canonicalize query: BadValue $or/$and/$nor entries need to be full objects - Doctrine

I am trying to covert this query db.getCollection('queues').find({ $and:[ {queue: 'testo'}, {$or: [ {$and: [{reserved_at: null}, {available_at:{'$lte':1490323024}}]}, {reserved_at:{'$lte':1490323024}} …
nicholasnet
  • 2,117
  • 2
  • 24
  • 46
1
vote
1 answer

Doctrine MongoDB ODM does not persist

I'm trying to start using MongoDB with Doctrine MongoDB ODM 1.1.3 and Laravel 5.4. Everything had been going fine before I removed the database called "doctrine" manually (the default database name I guess) in order to clean up the rubbish in it, so…
super.t
  • 2,526
  • 7
  • 32
  • 51
1
vote
1 answer

Doctrine ODM - Specify collection name for MappedSuperclass

Doctrine ODM has annotation (collection) to specify which name should be used for collection. It defaults to class name but can be changed easily. However I have mapped superclass which is extended by other classes. Inheritance type is single…
Josef Sábl
  • 7,538
  • 9
  • 54
  • 66
1
vote
1 answer

Doctrine ODM with manual reference

Suppose we have the following documents with relationship between them: /** * @ODM\Document(collection="foo") */ class Foo { /** @ODM\Id(name="_id", strategy="NONE", type="string") */ public $id; /** @ODM\Field(name="name",…
memo
  • 273
  • 2
  • 15
1
vote
1 answer

Doctrine ODM bi-direction reference with inheritance

I have this problem: I have several documents that extend some base document. All of these documents have sort of note feature meaning that users can add notes to them. I thus have Note document that is stored in separate collection (it needs to be…
Josef Sábl
  • 7,538
  • 9
  • 54
  • 66
1
vote
2 answers

Altering another document in Doctrine ODM PreUpdate event

Fairly new at MongoDB and Doctrine both. I'm currently setting up a model system for my framework, and trying to implement the events. The idea is this: When a certain model gets updated, a new user (also a model) should be created/updated. I do…
1
vote
1 answer

Symfony2 Docrine ODM: dynamic collection name

I'm using MongoDB Doctrine ODM on a Symfony 2 project. In the documents classes the mapping metadata are specified by annotations. For example: /** * @MongoDB\Document(collection="statistiche") */ The collection name in this way is…
DanieleVT
  • 131
  • 6
1
vote
2 answers

Two reference to one Document

How can I make two reference to one Document? I try: /** * @MongoDB\Document */ class Category { /** * @MongoDB\Id */ protected $id; /** * @MongoDB\ReferenceMany(targetDocument="Post", mappedBy="category") */ …
yakuj
  • 11
  • 2
1
vote
1 answer

Mongo mapreduce - use $dateToString on mapping stage

I have simple collection of elements with following structure: { _id: MongoId pvs: int day: IsoDate() uid: int } I'd like to use MapReduce to count pageviews for given user, grouped by certain date range (day/week/month, date format…
ex3v
  • 3,518
  • 4
  • 33
  • 55
1
vote
0 answers

doctrine odm embedded documents wont load automatically

I have this basic document and embedded document inside it i took it from the official doc User: type: document embedOne: address: targetDocument: Address Address: type: embeddedDocument When i load the user document i expect the…
bitgandtter
  • 2,179
  • 6
  • 31
  • 60
1
vote
1 answer

Is it possible to get the actual class name instead of the proxy class name from a lazy loaded object using Doctrine's MongoDB ODM?

Prior to beginning upgrade work to update my application to Symfony 3, and with it upgrading several libraries (including Doctrine) to more recent versions, I was able to compare references in a query to the results of an earlier query. I was able…
Sean Quinn
  • 2,131
  • 1
  • 18
  • 48
1
vote
1 answer

Get array of referenced ids in Doctrine ODM

I have a Company class that references users: /** * @MongoDB\Document() */ class Company { /* ... */ /** * @MongoDB\ReferenceMany(targetDocument="Topboard\UserBundle\Document\User", inversedBy="companies") */ protected…
Websirnik
  • 1,372
  • 3
  • 21
  • 35
1
vote
1 answer

ZF2: TableGateway vs Doctrine2

Can you list pluses and minuses native ORM opposite Doctrine? ZF1 had very proger-fiendly native ORM for me (Zend_Db_Table and Zend_Db_Table_Row), Zend\Db\TableGateway\TableGateway and Zend\Db\RowGateway\RowGateway is continue of this. Why most…
1
vote
1 answer

Symfony3 / Doctrine MongoDB ODM: other folder than Bundle/Documents?

Is it possible to place your Entity models in a different place than Bundle/Documents in Symfony3? I had an entity model in Bundle/Documents/Product.php and it was working fine. Then I changed the location to Bundle/Entity/Product and updated the…
Tim Strijdhorst
  • 1,539
  • 3
  • 14
  • 29