<?php

class SQLBoolTranslator implements ITranslator {



	protected $true;
	protected $false;



	public function __construct($true = null, $false = null) {
		if ($true === null or $false === null) {
			$adapter = DBFactory::getAdapter();
			$dialect = $adapter->getDialect();
			$this->true = ($true === null) ? $dialect->getTrue() : $true;
			$this->false = ($false === null) ? $dialect->getFalse() : $false;
		} else {
			$this->true = $true;
			$this->false = $false;
		}
	}



	public function vtom($value) {
		return $value ? $this->true : $this->false;
	}



	public function mtov($value) {
		return $value ? $this->true : $this->false;
	}



} // class SQLBoolTranslator

?>