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 ORM column type is integer[]

Hi i have a problem. I have a table that contains the columns: id(PK), name(text), mix(integer[])

i use postgresql and i try to execute condition:

> SELECT * FROM table t WHERE 1 <> ALL(mix)

> Table::find(['conditions' => '1 <> ALL(mix)']);

> PHP Fatal error: Uncaught Phalcon\Mvc\Model\Exception: Syntax error, unexpected EOF in

How to handle array types in the Phalcon? documentation says nothing about. (Phalcon\Mvc\Model\Resultset\Simpl is a last resort)

Hi @l770277 try with this

Table::find([
    'conditions' => '1 <> ALL({mix:array-int})', 
    'bind' => [
        'mix' => [1,2,3, ... ] // your integer[]
    ]
]);

{param:array-int} works with integer array. If you want string only use {param:array}

Then you can read binding parameters docs

Good luck



314

Thank you for the answer. But 'mix' is the column, not a array parameter. '1' is value of mix(ok '1' should be bind parameter). I want to find rows contains 1 in mix column



9.0k
Accepted
answer

Well All() function is supported by PHQL dialect. You can try with use a raw sql or comment that line to check that the error is there