when i use 'columns' option in the find method,
like
$data = (new model())-> find(array('','columns'=>array('*,count(1) as 'total')));
and then,
print_r($data->array());
there is no method ->array()
Also instead of:
$data = (new model())-> find(array('','columns'=>array('*,count(1) as 'total')));
do:
$data = Model::find(['columns'=>array('*,count(1) as 'total')]);
@sergeyklay
sorry, It's a mistake;
but ,you can try this
$data = Model::find(['columns'=>array('*,count(1) as 'total')]);
var_dump($data->toArray());
it's no an array
$data = Model::find(['columns'=>array('*,count(1) as 'total')]);
var_dump($data->toArray());
This is mistake too, you need it like this:
$data = Model::find(['columns'=>array('*','count(1) as total')]);
var_dump($data->toArray());
For questions like these please use the forum: http://forum.phalconphp.com/, GitHub is only intended to report bugs and discuss new features.
tks 4 help
Most helpful comment
For questions like these please use the forum: http://forum.phalconphp.com/, GitHub is only intended to report bugs and discuss new features.