library/Extlib/Generator.php
static protected function phalconQuery($modelName, $field, $generate)
    {
        $return = \Phalcon\Mvc\Model::query()
                                    ->setModelName($modelName)
                                    ->where("$field = :value:")
                                    ->bind(array('value' => $generate))
                                    ->execute();

        return (boolean) $return->count();
    }
static protected function phalconQuery($modelName, $field, $generate)
    {
        $return = \Phalcon\Mvc\Model::query()
                                    ->setModelName($modelName)
                                    ->where("$field = :value:")
                                    ->bind(array('value' => $generate))
                                    ->execute();

        return (boolean) $return->count();
    }
Phalcon generate query

@param string $modelName
@param string $field
@param string $generate
@return int