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
0 answers

Retrieve empty objects without having an empty array from MongoDB with PHP

The problem Empty objects in Mongo are decoded to empty array in PHP. It leads to a problem that after I do json_encode($data) the values which supposed to be {} in json are encoded to []. Configuration Image you have a document mapped to Mongo like…
maectpo
  • 814
  • 2
  • 10
  • 22
1
vote
0 answers

Doctrine ODM annotations not found in model

I am having an issue with an model while the others works succesfully. I get this error: Type: Doctrine\Common\Annotations\AnnotationException Code: 0 Message: [Semantical Error] The annotation "@Doctrine\ODM\MongoDB\Mapping\Annotations\Document" in…
1
vote
1 answer

Doctrine ODM Unique constraint not validating property

I can't figure out why Doctrine's ODM Unique constraint isn't working for me. Below is a Page Class with the property "title", that needs to be unique amongst all Pages. namespace App\Document; use Symfony\Component\Validator\Constraints as…
Tim Newey
  • 21
  • 3
1
vote
1 answer

How to debug Doctrine ODM query

Is there any way to dump the query from a Doctrine Mongodb ODM query builder. Something like $builder->getQuery()->toString() is what I am looking for. Any alternative would be useful. And also a way to dump parameters. I need to see in a…
Bluebox
  • 373
  • 2
  • 12
1
vote
1 answer

PUT operation creates new embedded document instead of updating it on Api Platform

I am stuck on an issue I cannot solve for few days now. As said in the title, Api Platform PUT operation based on annotations doesn't work as expected with regards to partial update on embedded document with MongoDB ODM. Indeed, despite all the…
Domopus
  • 31
  • 8
1
vote
1 answer

Symfony 4 / MongoDB / Docker multiple entries when saving data

I'm using Symfony 4 and MongoDB with docker and i want to save a new document (only one) on my database but multiple entries are inserted. .env file…
as-dev-symfony
  • 353
  • 4
  • 23
1
vote
1 answer

doctrine odm annotations or composer autoload.php not working?

I'm trying to use Doctrine MongoDB ODM 2.0 beta on a project with the Yii2 framework, with composer version 1.8.4 and PHP 7.2, but I keep getting the error Fatal error: Uncaught Error: Call to a member function add() on boolean where the code runs…
klickers
  • 31
  • 5
1
vote
1 answer

PHP Discussion - pass parameters as array or a "Configuration" Class

First, if this question doesn't belong here (and there is a better place for it), let me know. Second, I'm asking this question about "code quality", not "performance". Third, This isn't really related to PHP but as each laguage have their "Good…
Etshy
  • 870
  • 7
  • 25
1
vote
1 answer

Multiple Doctrine implementation

I'm using Symfony4 and Doctrine and I'd like to make my app "compatible" with both ODM and ORM. For that I changed my Documents (my app was originally ODM only) into "generic models" (move from App\Model\Documents to App\Model\Persistence) and I try…
Etshy
  • 870
  • 7
  • 25
1
vote
1 answer

How to embed MongoDB documents in Symfony 3.4

I´m new in Symfony 3.4 and I am try to embed a document into another document, like this: { name:"alex", age: 18, schoolGrades:{ elementary: "yes", highScholl: "yes", college: "no" } } I´m using Doctrine ODM to work this, but I don´t…
Robert_Rmz
  • 47
  • 1
  • 8
1
vote
1 answer

Doctrine Mongodb ODM Add Dynamic Dates in Aggregation

I'm trying to know if specific motorcycle in date range has contract or not. My schema looks like: { "_id" : ObjectId("575b7c0b0419c906e262d54b"), "customer" : { "id" : ObjectId("575b7c0b0419c906e262d54b") …
user2620369
  • 173
  • 1
  • 5
1
vote
1 answer

symfony4: There is no extension able to load the configuration for "doctrine_mongodb"

I have an issue to configure doctrine odm with Symfony4.1 I got an error message on composer update, cache:clear subcommand There is no extension able to load the configuration for "doctrine_mongodb" (in …
Thomas Dupont
  • 417
  • 6
  • 20
1
vote
1 answer

How to implement "alsoLoad" with YAML mapping (Symfony)

I use Doctrine 2 as ODM (mongoDB) in Symfony framework. I have done a YAML-based mapping for entities and it works well. But now, there is a field that has changed from "direction" to "destination", so I'm trying to use "alsoLoad" to keep it working…
Diana
  • 21
  • 3
1
vote
1 answer

Symfony4. ParamConverter annotation conflicts injecting a service by autowire

When I try to use @ParamConverter annotation in a Controller action, I get an error "Cannot resolve argument $company of \"App\\Controller\\ProfileController::top()\": Cannot autowire service \".service_locator.0CrkHeS\": it references class…
Phantom
  • 362
  • 3
  • 10
1
vote
1 answer

softdeleteable filter not working in Symfony with mongodb

We are creating an API-REST with Symfony 3.4 and using mongodb as db All the mapping and cofiguration has been done, and it works. buuuuuuuttt... The softdeleteable filter is not working, I mean: If I "delete" one document, the deletedAt works…
Diana
  • 21
  • 3