本文整理汇总了PHP中MDB2::loadModule方法的典型用法代码示例。如果您正苦于以下问题:PHP MDB2::loadModule方法的具体用法?PHP MDB2::loadModule怎么用?PHP MDB2::loadModule使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MDB2
的用法示例。
在下文中一共展示了MDB2::loadModule方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: datatype_test_callback
/**
* A test callback function to be used in the test class below for
* ensuring that custom datatype callback features are handled
* correctly.
*
* @param MDB2 $db The MDB2 database reource object.
* @param string $method The name of the MDB2_Driver_Datatype_Common method
* the callback function was called from. One of
* "getValidTypes", "convertResult", "getDeclaration",
* "compareDefinition", "quote" and "mapPrepareDatatype".
* See {@link MDB2_Driver_Datatype_Common} for the
* details of what each method does.
* @param array $aParameters An array of parameters, being the parameters that
* were passed to the method calling the callback
* function.
* @return mixed Returns the appropriate value depending on the method that
* called the function. See {@link MDB2_Driver_Datatype_Common}
* for details of the expected return values of the five possible
* calling methods.
*/
function datatype_test_callback(&$db, $method, $aParameters)
{
// Ensure the datatype module is loaded
if (is_null($db->datatype)) {
$db->loadModule('Datatype', null, true);
}
// Lowercase method names for PHP4/PHP5 compatibility
$method = strtolower($method);
switch ($method) {
// For all cases, return a string that identifies that the
// callback method was able to call to the appropriate point
case 'getvalidtypes':
return 'datatype_test_callback::getvalidtypes';
case 'convertresult':
return 'datatype_test_callback::convertresult';
case 'getdeclaration':
return 'datatype_test_callback::getdeclaration';
case 'comparedefinition':
return 'datatype_test_callback::comparedefinition';
case 'quote':
return 'datatype_test_callback::quote';
case 'mappreparedatatype':
return 'datatype_test_callback::mappreparedatatype';
}
}