doctrine-odm

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

随声附和 提交于 2021-01-28 06:37:23
问题 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 different configurations I tried, I didn't succeed in updating an embedded document already set in a parent document. I tried to change annotations in relevant documents, for example by changing normalization and denormalization groups, by trying

Doctrine ODM returns proxy object for base class instead of sub-classed document

余生颓废 提交于 2020-01-24 21:50:09
问题 During my work on providing new functionality to my project, I decided to expand models. I decided to use base class, grouping common methods, with few sub-classes, all kept in a single collection. Base, abstract class: /** * @MongoDB\Document(repositoryClass="EntryRepository") * @MongoDB\MappedSuperclass * @MongoDB\InheritanceType("SINGLE_COLLECTION") * @MongoDB\DiscriminatorField(fieldName="type") * @MongoDB\DiscriminatorMap({"entry"="Application_Model_Entry", "image"="Application_Model

Doctrine - How to hydrate a collection when using query builder

我的梦境 提交于 2020-01-04 03:56:07
问题 A previous question I asked was to do with hydrating a result set when using Doctrine and query builder. My issue was how to return an array and their sub-sets: This was for a single result set and the answer was quite simple: $qb = $this->stoneRepository->createQueryBuilder('S'); $query = $qb->addSelect('A','P','I','C') ->leftJoin('S.attribute', 'A') ->leftJoin('A.category', 'C') ->innerJoin('S.product' , 'P') ->innerJoin('S.image' , 'I') ->where('S.id = :sid') ->setParameter('sid', (int)

Doctrine undefined function apc_fetch

左心房为你撑大大i 提交于 2020-01-01 08:17:28
问题 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() in /Applications/XAMPP/xamppfiles/htdocs/emma_watson_shrine/application/libraries/Doctrine/Common/Cache/ApcCache.php on line 52 Can you help me out? 回答1: You need to enable the APC extension for PHP. Follow this guide. Alternatively, you could use a

Wrong distance in geonear method with Doctrine MongoDB ODM

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-24 20:22:32
问题 I'm using DoctrineMongoDBBundle with Symfony2 and I've a problem with geocoordinates. This works fine but when the longitude is for example like that: 0.635467 the code doesn't work. I have more geocoordinates and only fails when it begins with 0. and the distance field is NULL. This is my code: $locations = $dm->createQueryBuilder('MyBundle:Location') ->field('id')->in($arrayIds) ->field('geocoordinates') ->geoNear($geocodes['lat'],$geocodes['lon']) ->getQuery()->execute()->toArray(); I'm

How to generate document with Symfony 3.4 using Symfony flex

老子叫甜甜 提交于 2019-12-24 19:46:38
问题 With Symfony flex, one of the change is that there is no default bundle when using the symfony/skeleton. I don't find a way to use the command doctrine:mongodb:generate:documents in this context. Could you please tell me how to use it ? Exemple: php bin\console doctrine:mongodb:generate:documents App 2018-02-17T18:35:22+00:00 [error] Error thrown while running command "doctrine:mongodb:generate:documents AppBundle --document Test". Message: "No bundle AppBundle was found." In

Right way to define MongoDB in config.yml

断了今生、忘了曾经 提交于 2019-12-24 17:27:35
问题 I'm using MongoDB in my project but apparently Doctrine update their bundle and now I'm having issues if I run "composer update" command. This is my doctrine.yml file: # ODM doctrine_odm.mongodb: connections: default: server: mongodb://%mongo_host%:%mongo_port% options: {} default_database: %mongo_database% document_managers: default: auto_mapping: true But I get this error: [Symfony\Component\DependencyInjection\Exception\InvalidArgumentException] There is no extension able to load the

Doctrine ODM MongoDB EmbedOne Document not loaded

為{幸葍}努か 提交于 2019-12-24 10:23:57
问题 I need to store some data for our booking and thats include the customer data, which I want as embedded document within my booking document. With my current configuration all data are persisted in MongoDB, but when I load the booking document, there is no related customer object. Did I forget some configuration or something else? This is how my documents look like: The Booking-Document: <?php namespace AppBundle\Document; use Doctrine\ODM\MongoDB\Mapping\Annotations as MongoDB; /** * @MongoDB

Why does recursive submodule update from github fail for DoctrineMongoORMModule?

∥☆過路亽.° 提交于 2019-12-23 16:16:14
问题 Is this something I am doing wrong, or a wider bug? If I execute the following git commands in an empty directory: git init git submodule add https://github.com/doctrine/DoctrineMongoODMModule \vendor\DoctrineMongoODMModule git submodule update --init --recursive The all goes well, multiple submodules are pulled, and then it fails with the following output: fatal: not a git repository: ../../../../../../../../../../.git/modules/vendor/DoctrineMongoODMModule/modules/vendor/mongodb-odm/modules

How to make username case insensitive in zf2

旧城冷巷雨未停 提交于 2019-12-23 08:57:18
问题 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 Harib or harib access how i fix this? Here is my code: public function loginAction() { $this->layout('layout/login-layout.phtml'); $login_error = false; $loginForm = new LoginForm(); $form_elements = json_encode($loginForm->form_elements); if ($this-