You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When overriding the findFirst method with columns I get an error: "Lib\\Models\\RobotError::findFirst(): Return value must be of type ?Phalcon\\Mvc\\ModelInterface, Phalcon\\Mvc\\Model\\Row returned"
Steps to reproduce the behavior:
Model without redefining method findFirst
<?phpnamespaceLib\Models;
usePhalcon\Mvc\Model;
class RobotCorrect extends Model
{
public$id;
public$title;
public$deleted;
}
RobotCorrect::findFirst(["columns" => "title"]);
// Result: correct behavior
Model with redefining method findFirst
<?phpnamespaceLib\Models;
usePhalcon\Mvc\Model;
class RobotError extends Model
{
public$id;
public$title;
public$deleted;
publicstaticfunctionfindFirst($params = null): ?ModelInterface
{
returnparent::findFirst($params);
}
}
RobotError::findFirst(["columns" => "title"]);
// Result: error "Lib\\Models\\RobotError::findFirst(): Return value // must be of type ?Phalcon\\Mvc\\ModelInterface, Phalcon\\Mvc\\Model\\Row returned"
Details
Phalcon version: 5.0.0beta2
PHP Version: 8.0.15
Operating System: Docker from php:8.0-fpm-alpine
Installation type: pecl package
Server: Nginx + fpm
Database: Mysql 8
The text was updated successfully, but these errors were encountered:
I also get this error using phalcon 4, Can we merge #15890 together into 4? For some reason, I was unable to upgrade to 5. Thanks for any answers. @niden
When overriding the
findFirst
method withcolumns
I get an error:"Lib\\Models\\RobotError::findFirst(): Return value must be of type ?Phalcon\\Mvc\\ModelInterface, Phalcon\\Mvc\\Model\\Row returned"
Steps to reproduce the behavior:
Model without redefining method findFirst
Model with redefining method findFirst
Details
5.0.0beta2
8.0.15
Docker from php:8.0-fpm-alpine
pecl package
Nginx + fpm
Mysql 8
The text was updated successfully, but these errors were encountered: