[MODM-149] Fix PHPDoc @return types in various places Created: 05/Jul/11 Updated: 05/Apr/12 |
|
| Status: | Open |
| Project: | Doctrine MongoDB ODM |
| Component/s: | Document Manager |
| Affects Version/s: | 1.0.0BETA3 |
| Fix Version/s: | None |
| Type: | Documentation | Priority: | Critical |
| Reporter: | Dayson Pais | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
In certain PHPDoc blocks for functions, the @return type is not of the right type. This causes auto-completion issues in various IDEs (I'm using PhpStorm). For example, in \Doctrine\ODM\MongoDB\DocumentManager on line #341 the ->createQueryBuilder($documentName = null) function. /**
|
| Comments |
| Comment by Lee Davis [ 05/Apr/12 ] |
|
This appears to be fixed in 1.0.0BETA4-DEV Line 357 in Doctrine\ODM\MongoDB\DocumentManager... /**
|
[MODM-116] Collection Per Class Inheritance : Documents of a child class referenced in a parent class may be saved to the parent collection Created: 07/Feb/11 Updated: 21/Apr/11 |
|
| Status: | Reopened |
| Project: | Doctrine MongoDB ODM |
| Component/s: | Document Manager |
| Affects Version/s: | 1.0.0BETA3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Critical |
| Reporter: | JF Bustarret | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Here is my class hierarchy (classes & attributes renamed for a better understanding) :
/** @Document @InheritanceType("COLLECTION_PER_CLASS") **/
class Parent {
/** @ReferenceOne(targetDocument="Child") **/
protected $child;
}
/** @Document **/
class Child extends Parent {
}
When doing : $parent->setXXX($value); $parent->getChild()->setXXX($value2) the $parent->getChild() document is saved to the Parent collection. It looks like the problems lies in UnitOfWork::executeUpdates :
if (get_class($document) == $className || $document instanceof Proxy && $document instanceof $className) {
$child_document is an instance of Proxy (ChildProxy) and also an instance of Parent => saved using the Parent persister. Shouldn't the test be : get_class($document) == $className || get_class($document) == $className_of_Proxy ? As a side note : why "if ($class->isEmbeddedDocument) { continue; }" is within the foreach and not a "if ($class->isEmbeddedDocument) { return; }" at the beginning of the method ? |
| Comments |
| Comment by Jonathan H. Wage [ 11/Feb/11 ] |
|
I added a test for this here and it appears to be passing: https://github.com/doctrine/mongodb-odm/commit/3f24d77cc04adc0bb5532333e33826100457c666 |
| Comment by JF Bustarret [ 11/Feb/11 ] |
|
I'll try to get more info on the problem and provide a test for it. |
| Comment by JF Bustarret [ 28/Mar/11 ] |
|
Here is a new test case :
/** @Document
* @InheritanceType("COLLECTION_PER_CLASS")
**/
class MODM116Parent
{
/** @Id */
private $id;
/** @String */
private $name;
/** @ReferenceOne **/
private $child;
public function getId()
{
return $this->id;
}
public function getName()
{
return $this->name;
}
public function setName($name)
{
$this->name = $name;
}
public function getChild()
{
return $this->child;
}
public function setChild(MODM116Child $child)
{
$this->child = $child;
}
}
/** @Document **/
class MODM116Child extends MODM116Parent
{
/** @EmbedMany(targetDocument="MODM116Embedded") **/
protected $embedded;
function addEmbedded($parent) {
$this->embedded[] = new MODM116Embedded($parent);
}
}
/** @EmbeddedDocument **/
class MODM116Embedded {
/** @ReferenceOne(targetDocument="MODM116Parent") **/
protected $parent;
public function __construct($parent) {
$this->parent = $parent;
}
}
$parent = new MODM116Parent();
$parent->setName('test');
$parent->setChild(new MODM116Child());
$dm->persist($parent->getChild());
$dm->persist($parent);
$dm->flush();
$dm->clear();
$parent = $dm->getRepository(get_class($parent))->findOneBy(array('name' => 'test'));
$parent->getChild()->setName('ok');
$parent->getChild()->addEmbedded($parent);
$dm->flush();
|
| Comment by JF Bustarret [ 30/Mar/11 ] |
|
Pulled the last version from git. The bug still exists. |
| Comment by JF Bustarret [ 21/Apr/11 ] |
|
Up. Any news on a fix ? |
[MODM-153] "Near" Query does not work. Created: 10/Aug/11 Updated: 20/Feb/12 |
|
| Status: | Open |
| Project: | Doctrine MongoDB ODM |
| Component/s: | None |
| Affects Version/s: | 1.0.0BETA2 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Critical |
| Reporter: | Dmitry | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
"Near" statement does not work for me. The following code returns all cities from collection: $cities = $this->dm->createQuery('City')
->field('coordinates')->near(50, 60)
->execute();
Could you please fix it? |
| Comments |
| Comment by mark wright [ 02/Sep/11 ] |
|
It also does not work in beta3 but it fails differently. It never returns anything. $places = $documentManager->createQueryBuilder('Documents\Place') This returns 0 documents even though I have a point at 36.5788493, -121.7207805. Doctrine\MongoDB\Query\Builder::near() only takes one argument so the Y value is ignored. However, the docblock specifies 2 params. |
| Comment by Tim Sakharchuk [ 04/Sep/11 ] |
|
Hi All, Here is correct realization of this function in public function near($x, $y) { $this->query['type'] = Query::TYPE_GEO_LOCATION; $this->query['near'] = array($x, $y); return $this; }When may this fix appear in Doctrine ODM? Thanks! |
| Comment by Shane A. Stillwell [ 20/Feb/12 ] |
|
I had the same issue on 1.0.0.BETA3. The solution was to change the query up a little. $places = $this->dm->createQueryBuilder('\Application\Event')->field('latitude')->near(50)->field('longitude')->near(60)->getQuery()->execute();
|
[MODM-152] Single Collection Inheritance mapping does NOT work if the subclasses are in a different namespace Created: 09/Jul/11 Updated: 09/Jul/11 |
|
| Status: | Open |
| Project: | Doctrine MongoDB ODM |
| Component/s: | Mapping Drivers |
| Affects Version/s: | 1.0.0BETA3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Dayson Pais | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
I have described the issue in detail here: https://github.com/doctrine/mongodb-odm/issues/124 |
[MODM-151] Missing Annotation class HasLifecycleCallbacks Created: 07/Jul/11 Updated: 07/Jul/11 |
|
| Status: | Open |
| Project: | Doctrine MongoDB ODM |
| Component/s: | Mapping Drivers |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Miloslav "adrive" Kmet | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
latest MongoDB ODM from git master repository |
||
| Description |
|
Annotation class HasLifecycleCallbacks is missing in Doctrine\ODM\MongoDB\Mapping\Annotations |
[MODM-150] XSD file for XML mappings is incomplete Created: 07/Jul/11 Updated: 07/Jul/11 |
|
| Status: | Open |
| Project: | Doctrine MongoDB ODM |
| Component/s: | Mapping Drivers |
| Affects Version/s: | 1.0.0BETA3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | alcaeus | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Attachments: |
|
| Description |
|
The XSD file for XML mappings (http://www.doctrine-project.org/schemas/odm/doctrine-mongo-mapping.xsd) appears to be incomplete:
These are the problems I discovered at the moment, I haven't yet checked for more problems. The XSD file probably needs a bigger update. Attached is a patch file that adds the missing attributes, I haven't dug into Doctrine enough to create the mapped-superclass or embedded-document tags. |
[MODM-148] Do not add '$db' in reference when referencing document from same $db Created: 02/Jun/11 Updated: 02/Jun/11 |
|
| Status: | Open |
| Project: | Doctrine MongoDB ODM |
| Component/s: | Document Manager |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Vladimir Razuvaev | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
When using ReferenceOne or ReferenceMany , doctrine will create fully-qualified reference to the object (with all fields: '$id', '$ref', '$db') even when reference is within same $db. This approach causes several problems: for example we use mongo database as a template for new clients - when new client registers, template database is copied for him. But since it contains hardcoded $db - copy operation becomes resource consuming, since we have to loop through every document of every collection and fix $db reference. Also maintenance suffers, since you can't easily rename database when required. Is it possible to omit $db part when referencing document from same db? |
[MODM-147] No possibility to get a json object by a working document with toArray method (inluding all the embedded documents as arrays) Created: 28/May/11 Updated: 28/May/11 |
|
| Status: | Open |
| Project: | Doctrine MongoDB ODM |
| Component/s: | Collections |
| Affects Version/s: | 1.0.0BETA3 |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major |
| Reporter: | Stephan Salat | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Environment: |
Irrelevant |
||
| Description |
|
Description of the problem here: http://stackoverflow.com/questions/6155189/doctrine-odm-mongodb-get-a-complete-array-of-an-object Problem with the unincisive toArray() method. |
[MODM-142] DocumentRepository::findBy() not compatible with interface Created: 07/May/11 Updated: 07/May/11 |
|
| Status: | Open |
| Project: | Doctrine MongoDB ODM |
| Component/s: | Document Repositories |
| Affects Version/s: | 1.0.0BETA3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Jan Pieper | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
I want to get a document repository for my Document\Event document class but instead i get a fatal error. Pseudo <?php use Doctrine\MongoDB\Connection; use Doctrine\ODM\MongoDB\DocumentManager; use Doctrine\ODM\MongoDB\Configuration; use Documents\Event; $manager = new DocumentManager( new Connection(...), new Configuration(...) ); $manager->getRepository('Documents\Event');
DoctrineCommonPersistenceObjectRepository.php (github@5a285537) public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null); DoctrineODMMongoDBDocumentRepository.php (github@8d02e843) public function findBy(array $criteria) { ... }
|
[MODM-141] Doctrine ODM: Documentation error Created: 26/Apr/11 Updated: 26/Apr/11 |
|
| Status: | Open |
| Project: | Doctrine MongoDB ODM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Documentation | Priority: | Major |
| Reporter: | Diego Lewin | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
not applicable |
||
| Description |
|
I think that is a documentation issue, in http://www.doctrine-project.org/docs/mongodb_odm/1.0/en/reference/query-builder-api.html (15.3. Modifier Operations) the queries are like: $dm->createQueryBuilder('User') ->getQuery() But it is missing the update(), it should be like: $dm->createQueryBuilder('User') ->update() ->getQuery() All the queries in that section have similar issue |
[MODM-140] Issue with nested embdedded documents after adding an EmbeddedDocument to Document Created: 14/Apr/11 Updated: 19/Dec/11 |
|
| Status: | Open |
| Project: | Doctrine MongoDB ODM |
| Component/s: | UnitOfWork |
| Affects Version/s: | 1.0.0BETA3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Andrew Cobby | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 5 |
| Labels: | None | ||
| Environment: |
PHP 5.3.3, Mac OS X 10.6.6, MongoDB 1.8.0 |
||
| Attachments: |
|
| Description |
|
I'm using the latest version of Doctrine ODM (fresh from Git). I have three levels of Documents (Two embedded); Category -> EmbedsMany: Post -> EmbedsMany PostVersion. Step-by-step: 1. Make a new Post (Post1), 2 PostVersions (PostVersion1 and 2) and a Category If you're following properly, at this stage in the database there should be: However, what actually happens is: On StackOverflow: http://bit.ly/ekFbe2 A work around is to make Post2 and add it to Category, flush, then make new PostVersions and flush again. I did some debugging but I don't know enough about the internals to fix the issue. |
| Comments |
| Comment by Andrew Cobby [ 14/Apr/11 ] |
|
Failing test |
| Comment by Andrew Cobby [ 14/Apr/11 ] |
|
Added a test using the EmbdeddedTestLevelX Documents, please refer to Gist: https://gist.github.com/920914 For some reason, they work? I'm thinking maybe this isn't a bug... very confused at the moment. |
| Comment by Andras Revai [ 18/Jun/11 ] |
|
I've got the same problem. |
| Comment by Kelvin Wood [ 09/Aug/11 ] |
|
I had a similar problem, and resolved it with the attached patch (based on the 1.0.0beta3 release). This patch causes the ODM to stop scanning for changes further down the heirachy once it finds a new object, and then ensures that the Persistence Builder will include all contents of the new item. |
| Comment by Richard Shank [ 19/Dec/11 ] |
|
Kevin, do you want to put a PR in on github for this? |
[MODM-138] Field's name attribute does not work for the update queries Created: 07/Apr/11 Updated: 07/Apr/11 |
|
| Status: | Open |
| Project: | Doctrine MongoDB ODM |
| Component/s: | None |
| Affects Version/s: | 1.0.0BETA3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Başar Aykut | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Documents class Test
{
.
.
.
/**
* @EmbedOne(targetDocument="Location", name="l")
*/
private $location;
.
.
.
}
/** @EmbeddedDocument */
class Location
{
/**
* @Field(type="float", name="y")
*/
public $lat;
/**
* @Field(type="float", name="x")
*/
public $lng;
public function __construct($latitude,$longitude) {
$this->lat = $latitude;
$this->lng = $longitude;
}
}
Update query: $dm->createQueryBuilder('Test')
->update()
->field('id')->equals(123)
->field('l')->set(new Location(39, 32);
->getQuery(array('upsert' => true))
->execute();
Result of this query is "l": { "lat": 39, "lng": 32 }, however, it should be "l": { "y": 39, "x": 32 }, also field function can support field name of the class on update queries, as follows $dm->createQueryBuilder('Test')
->update()
->field('id')->equals(123)
->field('location')->set(new Location(39, 32);
->getQuery(array('upsert' => true))
->execute();
|
[MODM-139] [PATCH] @ReferenceMany with no referenceMapping cannot handle DBRef in all / in queries Created: 08/Apr/11 Updated: 08/Apr/11 |
|
| Status: | Open |
| Project: | Doctrine MongoDB ODM |
| Component/s: | Document Manager |
| Affects Version/s: | 1.0.0BETA3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Gérald Croes | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Environment: |
Linux, PHP 5.3 |
||
| Description |
|
I have thoose examples : /** @Document
* @InheritanceType("SINGLE_COLLECTION")
* @DiscriminatorField(fieldName="type")
* @DiscriminatorMap({"Test\Product"="Product", "Test\Year"="Year"})
*/
Attributes {
/** @Id */
protected $_id;
}
/** @Document */
class Product extends Attributes {}
/** @Document */
class Year extends Attributes {}
/**
* Classe de base pour les différents contenus
* @Document
* @InheritanceType("SINGLE_COLLECTION")
* @DiscriminatorField(fieldName="type")
* @DiscriminatorMap({"Test\Document"="Document", "Test\Infos"="Infos"})
*/
class Content
{
/** protected $_id */
/** @ReferenceMany */
protected $_attributes;
}
And the querying stuff //and the query :
$queryBuilder = $dm->createQueryBuilder('Test\DOcument');
//...
$attribute1Ref = $dm->createDBRef($attribute1Object);
$attribute2Ref = $dm->createDBRef($attribute2Object);
$queryBuilder->field('_attributes')->all(array($attribute1Ref, $attribute2Ref));
$queryBuilder->getQuery()->execute();//Won't work as the generated query won't specify the "_doctrine_class_name" value.
Proposed patch in DocumentManager : /**
* Returns a DBRef array for the supplied document.
*
* @param mixed $document A document object
* @param array $referenceMapping Mapping for the field the references the document
*
* @return array A DBRef array
*/
public function createDBRef($document, array $referenceMapping = null)
{
$className = get_class($document);
$class = $this->getClassMetadata($className);
$id = $this->unitOfWork->getDocumentIdentifier($document);
$dbRef = array(
$this->cmd . 'ref' => $class->getCollection(),
$this->cmd . 'id' => $class->getDatabaseIdentifierValue($id),
$this->cmd . 'db' => $this->getDocumentDatabase($className)->getName()
);
// add a discriminator value if the referenced document is not mapped explicitely to a targetDocument
if ($referenceMapping && ! isset($referenceMapping['targetDocument'])) {
$discriminatorField = isset($referenceMapping['discriminatorField']) ? $referenceMapping['discriminatorField'] : '_doctrine_class_name';
$discriminatorValue = isset($referenceMapping['discriminatorMap']) ? array_search($class->getName(), $referenceMapping['discriminatorMap']) : $class->getName();
$dbRef[$discriminatorField] = $discriminatorValue;
+ } elseif ($referenceMapping === null) {
+ $dbRef['_doctrine_class_name'] = $class->getName();
+ }
return $dbRef;
}
|
[MODM-128] Upserts in Query builder Created: 23/Feb/11 Updated: 23/Feb/11 |
|
| Status: | Open |
| Project: | Doctrine MongoDB ODM |
| Component/s: | None |
| Affects Version/s: | 1.0.0BETA2 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Billy Bob | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Mac OS X + MAMP |
||
| Description |
|
It seems that if you just call upsert(true) in a update request, it won't be enough. You have to calm getQuery(array('upsert' => true)) as well in order to have the 'insert if not exist' working. |
[MODM-129] Storing embeded documents containing embeded documents, already persistet in another collection fails Created: 25/Feb/11 Updated: 25/Feb/11 |
|
| Status: | Open |
| Project: | Doctrine MongoDB ODM |
| Component/s: | None |
| Affects Version/s: | 1.0.0BETA3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Kolja Treutlein | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
| Description |
|
We persist a document a1 containing an embedded document a1.1 which itself contains another embedded document a1.1.1. When the embedded document a1.1 is moved to another document of another collection b1 and needs to get persisted as embedded document b1.1 the embedded document a1.1.1 (which is now part of b1.1, too) is not saved as an embedded document of b1.1. Example: We use a version object which contains a pageversion as an embedded document. This page object contains multiple elements (stored as embedded documents) which themselves contain several parameter objects (stored as embedded document of elements). Now assume we have such a persisted version and want to "copy" the pageversion in another collection. So we generate a new page object, and add to this page all elements of the persisted pageversion. If we now persist this page, the representation in mongodb contains all elements but not any parameters, which should be part of the page as well (as they are part of an element). |
| Comments |
| Comment by Kolja Treutlein [ 25/Feb/11 ] |
|
Testcase |
| Comment by Jonathan H. Wage [ 25/Feb/11 ] |
|
Try cloning the embedded document when you move it. The reason why you have issues most likely is because internally inside Doctrine we keep track of each embedded document instance and what parent document it is attached to. So when you move it, Doctrine gets confused. You need to move it by cloning so the embedded document is actually a new object instance to Doctrine. |
[MODM-157] Github-PR-151 by l3pp4rd: fixes triggering fatal error on preupdate event in case changeset is clea Created: 25/Aug/11 Updated: 19/Sep/11 |
|
| Status: | Open |
| Project: | Doctrine MongoDB ODM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
This issue is created automatically through a Github pull request on behalf of {username}: Url: https://github.com/doctrine/mongodb-odm/pull/151 Message: fixes triggering fatal error on preupdate event in case changeset is cleared during onFlush similar issue is fixed in ORM it should be supported on ODM mongodb also |
| Comments |
| Comment by Dmitry Strygin [ 19/Sep/11 ] |
|
Hmm... The bug is still actual for ORM layer in master. |
| Comment by Vladimir Garvardt [ 19/Sep/11 ] |
|
Got the same issue for ORM in 2.1.1 and same in master. Made a fix based on fix for ODM and pull request on github. URL: https://github.com/doctrine/doctrine2/pull/126 PS: maybe new issue should be created in Doctrine 2 - ORM project for this issue |
[MODM-156] Github-PR-152 by vladar: Property ClassMetadata::file is not serialized Created: 25/Aug/11 Updated: 25/Aug/11 |
|
| Status: | Open |
| Project: | Doctrine MongoDB ODM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
This issue is created automatically through a Github pull request on behalf of {username}: Url: https://github.com/doctrine/mongodb-odm/pull/152 Message: This is causing errors, when saving gridfs files with persistent metadata cache engine (like apc, memcached, etc). I've also found same bug in Jira - http://www.doctrine-project.org/jira/browse/MODM-132 but seems that it is not fixed yet. Added fix + tests. |
[MODM-154] Github-PR-150 by tecbot: [XMLDriver] fixed an error in hydration classes when the name is not equal to the fieldName Created: 21/Aug/11 Updated: 21/Aug/11 |
|
| Status: | Open |
| Project: | Doctrine MongoDB ODM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
This issue is created automatically through a Github pull request on behalf of {username}: Url: https://github.com/doctrine/mongodb-odm/pull/150 Message: |
[MODM-155] Github-PR-148 by roed: fixed generating of classes Created: 21/Aug/11 Updated: 21/Aug/11 |
|
| Status: | Open |
| Project: | Doctrine MongoDB ODM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
This issue is created automatically through a Github pull request on behalf of {username}: Url: https://github.com/doctrine/mongodb-odm/pull/148 Message: fixed the generating of classes based on xml files, changed ClassMetadata to ClassMetadataInfo in these files (as in the ORM tool/mapping) the following did not work, but works after these changes: $metadatas = $cmf->getAllMetadata(); //this would break it // $this->_dm is an instance of Doctrine\ODM\MongoDB\DocumentManager |
[MODM-162] Introduction Tutorial,suitable version Created: 15/Feb/12 Updated: 15/Feb/12 |
|
| Status: | Open |
| Project: | Doctrine MongoDB ODM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Documentation | Priority: | Major |
| Reporter: | Hugues Leunsa | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
software |
||
| Description |
|
HI all, I am working on a project where I would like to use mongoDB ODM. But while following this tutotorial : http://docs.doctrine-project.org/projects/doctrine-mongodb-odm/en/latest/reference/introduction.html, it appears to me that the download odm library doesn't work with the code: missing code or undefined classes. Therefore I woulld like to know what's the corresponding version mongodb ODM of the tutorial. Thank's in advance regards near |
[MODM-161] Bug with index definition Created: 06/Feb/12 Updated: 15/Jun/12 |
|
| Status: | Open |
| Project: | Doctrine MongoDB ODM |
| Component/s: | Mapping Drivers |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Erwann Mest | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
MacOS 10.7.2 |
||
| Description |
|
All is there: https://gist.github.com/1682981 |
| Comments |
| Comment by Luis Cordova [ 15/Jun/12 ] |
|
github link has nothing it was removed |
| Comment by Luis Cordova [ 15/Jun/12 ] |
|
gist is a broken link |
[MODM-159] Querying a collection by Embedded objects identifier not working. Created: 30/Nov/11 Updated: 30/Nov/11 |
|
| Status: | Open |
| Project: | Doctrine MongoDB ODM |
| Component/s: | Persister |
| Affects Version/s: | 1.0.0BETA3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Dahuda Unal | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
OS:10.8.0 OSX |
||
| Description |
|
Reference objects identifiers are stored as '$id' in database when Embedded objects identifiers are stored as '_id'. When querying a collection by embedded objects identifier, DocumentPersister->prepareQueryValue() converts it to '$id' although it is stored in DB as '_id'. So querying for reference object ids work but embedded objects do not. DocumentPersister->prepareQueryValue() first checks if field has TargetDocument mapping, if it is true it checks if field is target document's identifier, if this also returns true Is this a bug / issue or am i missing something? |
[MODM-158] Doctrine\ODM\MongoDB\Mapping\Type\TimestampType should use MongoDate instead of MongoTimestamp Created: 24/Nov/11 Updated: 24/Nov/11 |
|
| Status: | Open |
| Project: | Doctrine MongoDB ODM |
| Component/s: | Mapping Drivers |
| Affects Version/s: | 1.0.0BETA3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Shane A. Stillwell | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
OS 10.7 PHP 5.3.6 with Suhosin-Patch (cli) (built: Sep 8 2011 19:34:00) |
||
| Attachments: |
|
| Description |
|
When using the @Timestamp mapping type for a class Doctrine uses MongoTimestamp and it creates very incorrect times in the DB. According to PHP documentation, you should not use MongoTimestamp for creating timestamps, instead MongoDate should be used. I've attached a patch that changes it to MongoDate and this works splendid when you assign a timestamp to a @Timestamp value /** * @Field(type="timestamp") */ protected $created_on; /** * @Field(type="timestamp") */ protected $updated_on; public function __construct($options = NULL) { $this->created_on = $this->updated_on = time(); parent::__construct($options); } |
[MODM-164] DocumentPersister's prepareQuery() method is not suitable for preparing newObj for update queries Created: 05/Apr/12 Updated: 05/Apr/12 |
|
| Status: | Open |
| Project: | Doctrine MongoDB ODM |
| Component/s: | Persister |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Juha Suni | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Doctrine\ODM\MongoDB\Query\Expr::getNewObj() uses Doctrine\ODM\MongoDB\Persisters\DocumentPersister::prepareQuery() method for preparing newObj. However, prepareQuery is not suitable for that. The first lines in prepareQuery method should apply to find queries only: if (is_scalar($query) || $query instanceof \MongoId) { Recommendation: DocumentPersister should introduce a new method, such as prepareNewObj($newObj) for preparing the newObj array. Expr::getNewObj() should be change to invoke the new method. |
[MODM-137] Undefined index 'criteria' in DocumentPersister Created: 04/Apr/11 Updated: 04/Apr/11 |
|
| Status: | Open |
| Project: | Doctrine MongoDB ODM |
| Component/s: | Persister |
| Affects Version/s: | 1.0.0BETA3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Kevin Bradwick | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
On the master branch, a notice is thrown on line 531 of the DocumentPersister for an undefined index 'criteria'. This is when using the Yaml driver. Full notice: Warning: array_merge(): Argument #2 is not an array in /Doctrine/ODM/MongoDB/Persisters/DocumentPersister.php on line 532 Catchable fatal error: Argument 1 passed to Doctrine\MongoDB\Collection::find() must be an array, null given, called in Doctrine/ODM/MongoDB/Persisters/DocumentPersister.php on line 533 and defined in /Doctrine/MongoDB/Collection.php on line 169 |
[MODM-136] Document's fields names are not properly converted to database names in a query Created: 27/Mar/11 Updated: 27/Mar/11 |
|
| Status: | Open |
| Project: | Doctrine MongoDB ODM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Eugene Leonovich | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Description |
|
Mappings: /** * @Field(type="date", name="scheduled_at") */ private $scheduledAt; /** * @Field(type="date", name="completed_at") */ private $completedAt; Query: $qb->field('scheduledAt')->lte($now)
->addOr($qb->expr()->field('completedAt')->lte($now))
->addOr($qb->expr()->field('completedAt')->equals(null))
->sort('scheduledAt', 'asc');
Expected result: db.foo.find({
"scheduled_at": { "$lte": new Date(...) },
"$or": [
{ "completed_at": { "$lte": new Date(...) } },
{ "completed_at": null } ]
})
.sort({ "scheduled_at": 1 });
Actual result: db.foo.find({
"scheduled_at": { "$lte": new Date(...) },
"$or": [
{ "completedAt": { "$lte": new Date(...) } },
{ "completedAt": null } ]
})
.sort({ "scheduledAt": 1 });
|
[MODM-134] Reference added twice Created: 24/Mar/11 Updated: 25/Mar/11 |
|
| Status: | Open |
| Project: | Doctrine MongoDB ODM |
| Component/s: | None |
| Affects Version/s: | 1.0.0BETA3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | jules b | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
I have a listener who listens on onFlush event, If i remove the call to $uow->recomputeSingleDocumentChangeSet() all is fine. Here's my document (notice references added twice on children property): array ( EDIT: if i clear() the $children ArrayCollection before calling $uow->recomputeSingleDocumentChangeSet() all is fine I tried to reproduce it in a test-case but the result wasn't successful |
[MODM-132] Doctrine\ODM\MongoDB\Mapping\ClassMetaData is loosing "file" property after serialization Created: 18/Mar/11 Updated: 18/Mar/11 |
|
| Status: | Open |
| Project: | Doctrine MongoDB ODM |
| Component/s: | Mapping Drivers |
| Affects Version/s: | 1.0.0BETA3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Andrei S | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
After ClassMetaData is awakened it looses the "file" property and that breaks our File model. I dumped ClassMetaData object with caching enabled and disabled. Here's the diff: 146c146 The first line is the missing file value. The second block appears to be missing indexes but I'm guessing this information should not be serialized. |
[MODM-131] Notice in Doctrine\MongoDB\GridFS::doInsert Created: 09/Mar/11 Updated: 09/Mar/11 |
|
| Status: | Open |
| Project: | Doctrine MongoDB ODM |
| Component/s: | None |
| Affects Version/s: | 1.0.0BETA3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Vitaliy Kaplich | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
CentOS 5.5, PHP 5.3 |
||
| Description |
|
Notice: Undefined variable: file in /projects/tbi/vendors/doctrine/odm/lib/vendor/doctrine-mongodb/lib/Doctrine/MongoDB/GridFS.php on line 112 |
[MODM-135] [Cursor] ReferenceMany sort mapping not working Created: 25/Mar/11 Updated: 26/Mar/11 |
|
| Status: | Open |
| Project: | Doctrine MongoDB ODM |
| Component/s: | None |
| Affects Version/s: | 1.0.0BETA3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | jules b | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Environment: |
Macosx |
||
| Attachments: |
|
| Description |
|
I have a document like this: /** @Document */ /** @ReferenceMany(sort= {"order"="asc"}) */ If i have well understood things, i can do: $blocks = $dm->getRepository('Page') blocks should now be sorted by $order property. This behaviour doesn't seems to work (or maybe i'm missing something). i made the priority major because in my case i haven't found a workaround (i'm using nested referenceMany, a child can have children, which can have children, ..). |
[MODM-170] Unique index on embedded document Created: 15/May/13 Updated: 15/May/13 |
|
| Status: | Open |
| Project: | Doctrine MongoDB ODM |
| Component/s: | Persister |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Szymon Karnecki | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Hi, Bug checked on versions: I've created unique index on embedded document and ODM seem not to be working properly. When unique index is violated MongoCursorException is thrown and this behavior is desired. Thrown exception: Grid document sketch: { _id: boxes:[DBref(Offer), DBref(Offer), DBref(Offer)] tag: DBref(Tag) }unique index on boxes.tag Any help would be appreciated. |
[MODM-145] QueryBuilder references() to does not support references on embedded objects' fields Created: 23/May/11 Updated: 25/Oct/11 |
|
| Status: | Open |
| Project: | Doctrine MongoDB ODM |
| Component/s: | Query Builder |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Minor |
| Reporter: | Jeremy Mikola | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
I noticed that the references() method does not support fields on embedded objects, as the argument to the preceding field() method will be passed into getFieldMapping() and trigger an exception. I suppose a solution would require multiple calls to getFieldMapping() in order to dive into the embedded object's class metadata. To demonstrate, below is an example of a UserRepository class. The User document contains an embeddedObject that itself references another User: class UserRepository extends DocumentRepository { public function findByEmbeddedObjectReference(User $user) { return $this->createQueryBuilder() ->field('embeddedObject.user.$id')->equals($user->getId()) // ->field('embeddedObject.user')->references($user) ->getQuery() ->execute(); } } Using field()/equals() works fine as an alternative to references(), so there is no urgent need for this feature. |
| Comments |
| Comment by Nicolas Brignol [ 25/Oct/11 ] |
|
Hi It seems that we have a problem with the temporary solution proposed : obj->field('embedded.referenced.$id')->equals($reference->getId())
will generate the query without "$id". Did someone experience this issue ? |
[MODM-144] Bi-Directional References Feature Created: 18/May/11 Updated: 18/May/11 |
|
| Status: | Open |
| Project: | Doctrine MongoDB ODM |
| Component/s: | None |
| Affects Version/s: | 1.0.0BETA3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Jan Gantzert | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Zend Framework 1.11.6 |
||
| Description |
|
I cant´t reproduce the Bi-Directional References with my own example or the example of the documentation. BlogPost.php /** @Document */ /** @String */ /** @String */ /** @String */ /** @String */ /** @ReferenceMany(targetDocument="PostComment", mappedBy="post") */ PostComment.php /** @Document */ /** @String */ /** @String */ /** @String */ /** @String */ /** @String */ /** @ReferenceOne(targetDocument="BlogPost", inversedBy="comments") */ CommentController.php $comment1 = new PostComment(); $comment2 = new PostComment(); $comment3 = new PostComment(); $dm->persist($comment1); echo $post->id; /*$posts = $dm->createQueryBuilder('BlogPost') $post = $dm->getRepository('BlogPost')->find('4dd45739f563724c23000002'); Zend_Debug::dump($post); ------------------------ Anyway, I can´t get the Comments from the mongodb. Greetings tronga |
[MODM-127] Update queries : update() required ? Created: 23/Feb/11 Updated: 23/Feb/11 |
|
| Status: | Open |
| Project: | Doctrine MongoDB ODM |
| Component/s: | None |
| Affects Version/s: | 1.0.0BETA2 |
| Fix Version/s: | None |
| Type: | Documentation | Priority: | Minor |
| Reporter: | Billy Bob | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
In the documentation exemples for update queries : it doesn't mention a update() function call any more in update queries. Did I miss something? |
[MODM-168] Can't Use Custom Repository Class for Embedded Doc When Using YAML Driver Created: 29/Jul/12 Updated: 29/Jul/12 |
|
| Status: | Open |
| Project: | Doctrine MongoDB ODM |
| Component/s: | Mapping Drivers |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Isaac Foster | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
When using the Yaml driver the ClassMetadata generation process won't create and use the indicated custom repository class for an embedded document. From what I can see digging into the actual code, it will work when using the Annotations or XML drivers, but in the Yaml driver the call to setCustomRepositoryClass is inside of a conditional that only gets entered if the document type is 'document'. I'm not completely sure, but from what I can see elsewhere in the code, it looks like mapped superclasses should also be able to have a custom repository class, but can't when using the Yaml driver. So I reckon what would work would be to change the code as indicated below: <<EXISTING CODE>> } elseif ($element['type'] === 'mappedSuperclass') { $class->isMappedSuperclass = true; }elseif ($element['type'] === 'embeddedDocument') { $class->isEmbeddedDocument = true; }<<TO THIS>> |
[MODM-169] Filter API is not unified between ODM and ORM Created: 10/Dec/12 Updated: 10/Dec/12 |
|
| Status: | Open |
| Project: | Doctrine MongoDB ODM |
| Component/s: | Document Manager |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor |
| Reporter: | Craig Marvelley | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Hi, I'm implementing some functionality around filters which will ideally work for both ORM and ODM. The API for managing filters is different on `Doctrine\ORM\EntityManager` and `Doctrine\ODM\MongoDB\DocumentManager`, while the CouchDB implementation of ODM has no filter concept. For example, ORM EntityManager has getFilters(), hasFilters(), while ODM MongoDB DocumentManager has getFilterCollection(). I was wondering what your thoughts were on defining the filter API in an interface, to improve consistency when implementing cross-library functionality? Thanks, |
[MODM-130] @ChangeTrackingPolicy notation is ignored in @MappedSuperclass Created: 02/Mar/11 Updated: 02/Mar/11 |
|
| Status: | Open |
| Project: | Doctrine MongoDB ODM |
| Component/s: | None |
| Affects Version/s: | 1.0.0BETA1 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Vitaliy Kaplich | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
CentOS 5.5, PHP 5.3 |
||
| Description |
|
I am not sure if it's supposed to be that @MappedSuperclass document can define @ChangeTrackingPolicy for multiple documents but in fact it does not work. In other words in the case below: /**
/**
=================================================== class Chart
At the same time if to define ChangeTrackingPolicy in the Chart class instead of MappedDocument it works as expected. |
[MODM-163] @ReferenceMany and Inheritance Created: 01/Mar/12 Updated: 01/Mar/12 |
|
| Status: | Open |
| Project: | Doctrine MongoDB ODM |
| Component/s: | Persister |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | julie sommerville | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
php 5.3 macosx 10.7.3 mongodb-odm 1.0 mongodb v2.0.2 |
||
| Description |
|
@ReferenceMany doesn't seem to work when used within a child class unless I specify @InheritanceType("CLASS_PER_COLLECTION") (which is fine b/c that works for our architecture) Here is an example from our code: //Parent Class use Doctrine\Common\Collections\ArrayCollection; /**
//** References
} //Child Class
If I don't add the @InheritanceType annotation the $more_touts data never gets persisted into the DB. |