Comments (8)
This needs to be fixed. Use the foreach and it will work.
Sent from my iPhone
On May 17, 2011, at 9:16 AM, [email protected] wrote:
Hello,
I make a query :
$users = $dm->getRepository('Documents\User')->findBy(array('username' => 'toto'));if I make that :
while($users->hasNext())
{
$user = $users->getNext();
print_r($user);
}The print_r shows me an array and not a User Document. Where is the problem ?
Please, help me.Reply to this email directly or view it on GitHub:
#95
from mongodb-odm.
Thanks, it works.
Now a last question :
I've generated a Repository for my User Document. And I have set that in the document with : repositoryClass="Repositories\UserRepository"
In this repository, I have defined a findByToto function.
But when I want to execute my function, I get this error :
Fatal error: Class 'Repositories\UserRepository' not found in .../mongodb_odm/lib/Doctrine/ODM/MongoDB/DocumentManager.php
from mongodb-odm.
Hi,
Make sure you specify the right path to the class.
That class cannot be found hence the error.
- Jon
On Tue, May 17, 2011 at 9:47 AM, arnobeck <
[email protected]>wrote:
Thanks, it works.
Now a last question :
I've generated a Repository for my User Document. And I have set that in
the document with : repositoryClass="Repositories\UserRepository"
In this repository, I have defined a findByToto function.
But when I want to execute my function, I get this error :
Fatal error: Class 'Repositories\UserRepository' not found in
.../mongodb_odm/lib/Doctrine/ODM/MongoDB/DocumentManager.phpReply to this email directly or view it on GitHub:
#95 (comment)
Connect with me on http://twitter.com/jwage http://twitter.com/jwage
and http://about.me/jwage to keep in touch.
from mongodb-odm.
It doesn't work.
I'm using the sandbox. I've just done :
./mongodb odm:generate:repositories
And in the user document, I've put :
/** @document(collection="users", repositoryClass="Repositories\UserRepository") */
class User
from mongodb-odm.
Hi,
Where does Repositories\UserRepository exist?
- Jon
On Tue, May 17, 2011 at 10:33 AM, arnobeck <
[email protected]>wrote:
It doesn't work.
I'm using the sandbox. I've just done :
./mongodb odm:generate:repositoriesAnd in the user document, I've put :
/** @document(collection="users",
repositoryClass="Repositories\UserRepository") */
class UserReply to this email directly or view it on GitHub:
#95 (comment)
Connect with me on http://twitter.com/jwage http://twitter.com/jwage
and http://about.me/jwage to keep in touch.
from mongodb-odm.
$ ls Repositories/*
Repositories/UserRepository.php
from mongodb-odm.
Do you have an autoloader setup to load those classes in that namespace?
- Jon
On Tue, May 17, 2011 at 10:43 AM, arnobeck <
[email protected]>wrote:
$ ls Repositories/*
Repositories/UserRepository.phpReply to this email directly or view it on GitHub:
#95 (comment)
Connect with me on http://twitter.com/jwage http://twitter.com/jwage
and http://about.me/jwage to keep in touch.
from mongodb-odm.
It was that, thanks
from mongodb-odm.
Related Issues (20)
- Cannot override the class metadata factory via configuration since 2.5.0 HOT 3
- Indices from sub classes always get re-created HOT 3
- The implementation of Countable on the CachingIterator is causing the UniqueEntityValidator to always fail HOT 2
- 2dsphere indexes get re-created everytime HOT 1
- Mapping validation does not validate targetDocument
- README link to API is broken HOT 1
- BC Break if the storeEmptyArray is not defined in the mapping HOT 8
- Add `dm` input option to commands that requires it
- GridFs HydratorException : Expected association field "metadata" to be of type "array", "object" received HOT 4
- Embedded Subset Pattern implementation HOT 2
- MongoDB-ODM & Spiral framework. HOT 1
- Update embed many attribute to empty array HOT 3
- Issues with the compatibility of getRepository() function in MongoDB DocumentManager and Persistence ManagerRegistry
- Document is insert and then updated during one flush operation HOT 4
- Saving documents with embedded collections and default storage strategy leads to inconsistent state between in memory objects and database HOT 1
- Duplicate objectToArray keys in AggregationOperatorsProviderTrait HOT 1
- Issue in flush When duplication index error occurs. HOT 1
- Proxy methods in CreateCommand may be obsolete
- Implement `skip-<feature>` options in CLI commands HOT 1
- Add CI workflow to check documentation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mongodb-odm.