Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Phalcon 2 BETA 3 - "Cannot use a scalar value as an array" with model metadata

Hi all,

I'm trying to use Phalcon 2 with my applicaton based on Phalcon 1.3.

I modify my code step by step because of type checking, but I have a problem with my models :

ErrorException: Cannot use a scalar value as an array in phalcon/mvc/model/metadata.zep on line 374

I use metadata annotation.

Thanks



83.4k

Could you please post the model + annotations that cause this exception?



1.4k
class Esi extends \Phalcon\Mvc\Model
{

    /**
     * @Primary
     * @Identity
     * @Column(type="integer", nullable=false)
     */
    public $id;

    /**
     * @Column(type="boolean", nullable=false)
     */
    public $statut;
}

The error is triggered by

Esi::count(array('statut > 0'))


83.4k
Accepted
answer

I've added a fix, could you please try again?



1.4k

It works!

Thanks