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

Phalcon model interface doens't allow false return #13947

Closed
ruudboon opened this issue Apr 5, 2019 · 3 comments

Comments

Projects
3 participants
@ruudboon
Copy link
Member

commented Apr 5, 2019

When I overload the findFirst and run a query that doesn't match I get the following error:
fatal error: Uncaught TypeError: Return value of MyModel::findFirst() must implement interface Phalcon\Mvc\ModelInterface, bool returned in xxxxx on line xx

Looks like the findFirst can return false but isn't allowed by the interface. Unsure why this only show when overloading the method.

@ruudboon ruudboon changed the title Return value of App\Models\Users::findFirst() must implement interface Phalcon\Mvc\ModelInterface, null returned Phalcon model interface doens't allow null return Apr 5, 2019

@ruudboon ruudboon changed the title Phalcon model interface doens't allow null return Phalcon model interface doens't allow false return Apr 5, 2019

@talal424

This comment has been minimized.

Copy link

commented Apr 5, 2019

return null or an instance of Phalcon\Mvc\ModelInterface

@ruudboon

This comment has been minimized.

Copy link
Member Author

commented Apr 5, 2019

@talal424 Interface doesn't allow null.

@niden niden added the Bug - Medium label Apr 5, 2019

@niden niden added this to To do in 4.0 Release via automation Apr 5, 2019

@niden niden referenced this issue Apr 5, 2019

Merged

T13947 model interface #13948

4 of 4 tasks complete
@ruudboon

This comment has been minimized.

Copy link
Member Author

commented Apr 5, 2019

Fastest bug fix ever! Thnx @niden

@ruudboon ruudboon closed this Apr 5, 2019

4.0 Release automation moved this from To do to Done Apr 5, 2019

niden added a commit that referenced this issue Apr 6, 2019

niden added a commit that referenced this issue Apr 6, 2019

niden added a commit that referenced this issue Apr 6, 2019

niden added a commit that referenced this issue May 9, 2019

@niden niden added the 4.0 label Jun 21, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.