<?php

class Tac_CustomImgCaptcha_Model_Counts extends XenForo_Model
{

	


	public function getCountsById($id)
	{
		return $this->_getDb()->fetchRow('
			SELECT *
			FROM sf_customimgcaptcha_counts 
			WHERE id = ?
		', $id);
	}

	public function getCountsByUuid($private_uuid)
	{
		return $this->_getDb()->fetchRow('
			SELECT *
			FROM sf_customimgcaptcha_counts 
			WHERE private_uuid = ?
		', $private_uuid);
	}

	public function getIsBotByIP($ip_address)
	{
		return $this->_getDb()->fetchRow('
			SELECT *
			FROM sf_foolbothoneypot_log 
			WHERE ip_address = ?
		', $ip_address);
	}


	public function getCountsForCaptcha($private_uuid)
	{
		return $this->_getDb()->fetchRow('
			SELECT *
			FROM sf_customimgcaptcha_counts 
			WHERE private_uuid = ?
		', $private_uuid);
	}

	public function countRows()
	{
		return $this->_getDb()->fetchOne('
			SELECT COUNT(id)
			FROM sf_customimgcaptcha_counts
		');
	}
	

}