MySQL2MySQLi/Function/GenericBoolean.php

26 lines
885 B
PHP

<?php
require_once('Generic.php');
/**
* Converter: generic converter with extra boolean cast
*
* @category Functions
* @package MySQLConverterTool
* @author Andrey Hristov <andrey@php.net>, Ulf Wendel <ulf.wendel@phpdoc.de>, Saif Lacrimosa <cool2309@gmail.com>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version CVS: $Id:$, Release: @package_version@
* @link http://www.mysql.com
* @since Class available since Release 1.0
*/
class MySQLConverterTool_Function_GenericBoolean extends MySQLConverterTool_Function_Generic {
public function handle(Array $params = array()) {
$params = $this->extractParamValues($params);
return array(NULL, sprintf('(($___mysqli_tmp = %s(%s)) ? $___mysqli_tmp : false)', $this->new_name, implode(", ", $params)));
}
}
?>