Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added ability to change document class to be returned in ODM #11063

Merged
merged 1 commit into from
Nov 17, 2015

Conversation

ashpumpkin
Copy link
Contributor

issue #11031
Usage:

Robots::find(); //returns Robots
Robots::find(['class' => 'Books']); // you get Books
Robots::find(['class' => 'Phalcon\Mvc\Collection\Document']); // you get Documents
Robots::find(['class' => 'UnknowClass']); // you get php error "Class 'UnknownClass' not found"
Robots::find(['class' => 'KnownClassNotImplementingInterface']); // you get phalcon exception "Object of class 'KnownClassNotImplementingInterface' must be an implementation of Phalcon\Mvc\CollectionInterface or an instance of Phalcon\Mvc\Collection\Document"

In case when exception must be thrown all other check become useless waste of time and that is why class check is made so early.

@andresgutierrez
Copy link
Contributor

Could you please rebase?

@sergeyklay
Copy link
Contributor

@andresgutierrez

andresgutierrez added a commit that referenced this pull request Nov 17, 2015
Added ability to change document class to be returned in ODM
@andresgutierrez andresgutierrez merged commit b59ce2f into phalcon:2.0.x Nov 17, 2015
@andresgutierrez
Copy link
Contributor

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants