<?php

namespace GriffinForms\Frontend\Sql;

class Form extends \GriffinForms\Frontend\Sql\Format
{
    protected $meta;

    public function submissionCount($form_id, $is_complete = 1)
    {
        global $wpdb;
        $table = $this->config->getTable('submission');
        $count = $wpdb->get_var(
            $wpdb->prepare(
                'SELECT COUNT(id) FROM %i WHERE form_id=%d AND status=%d',
                $table,
                $form_id,
                $is_complete
                )
        );

        return $count;

    }
}