Counting models doesnt work

When trying to count some data using this way:
https://docs.phalconphp.com/en/latest/reference/models.html#generating-calculations

User::count(array('name' => 'Foo'));

It always returns the full range of users so I get x instead of 1.
For me its weird because I'm sure it worked.

edited Jul '15

Where type : User::count("name = 'Foo' ");



3.1k
edited Jul '15

Hmm, could work but I'll need some protection against SQL-Injection.

It works now using a similar method like this, but I still would use my way.. when it works.

$count = User::count(array(
    'name > ?0'
    'bind' => array('Foo')
));

Hmm, guess I'm not the only one trying to use associative arrays as condition :] https://forum.phalconphp.com/discussion/7821/modelfind-modelfindfirst-conditions-from-associative-array