We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

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



98.9k

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



2.1k
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'))


98.9k
Accepted
answer

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



2.1k

It works!

Thanks