code: 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();
      }
docs: Phalcon generate query
  
  @param string $modelName
  @param string $field
  @param string $generate
  @return int