Hi.
I found a very strange behavior. Table 'templates' in my DB has 2 records.
When I try fetch them using code:
Templates::query()
->where('template_status = 1')
->andWhere('delete_datetime IS NULL')
->andWhere('id_template_format = :idFormat:', array('idFormat' => 1), array('idFormat' => \Phalcon\Db\Column::BIND_PARAM_STR))
->andWhere('id_template_type = :idType:', array('idType' => 1), array('idType' => \Phalcon\Db\Column::BIND_PARAM_INT))
->execute();
I get 2 records - correctly.
However, if I use this in Templates model:
$this->getModelsManager()->createBuilder()
->from('ApiMerge\Models\VproducterTemplates')
->andWhere('id_template_format = :idFormat:', array('idFormat' => 1), array('idFormat' => \Phalcon\Db\Column::BIND_PARAM_INT))
->andWhere('id_template_type = :idType:', array('idType' => 1), array('idType' => \Phalcon\Db\Column::BIND_PARAM_STR))
->getQuery()
->execute();
I don't get any records.
Furthermore, when I use:
(...)
->andWhere('id_template_format = :idFormat:', array('idFormat' => 1), array('idFormat' => \Phalcon\Db\Column::BIND_PARAM_STR))
->andWhere('id_template_type = :idType:', array('idType' => 1), array('idType' => \Phalcon\Db\Column::BIND_PARAM_STR))
(...)
I get only 1 record.
I did not find any information about this type of error. I'll be very grateful for any help.