本文整理匯總了PHP中DB_DataObject::sequenceKey方法的典型用法代碼示例。如果您正苦於以下問題:PHP DB_DataObject::sequenceKey方法的具體用法?PHP DB_DataObject::sequenceKey怎麽用?PHP DB_DataObject::sequenceKey使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DB_DataObject
的用法示例。
在下文中一共展示了DB_DataObject::sequenceKey方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: sequenceKey
/**
* Generate sequenceKey Function - used generator_no_ini is set.
*
* @param array table and key definition.
* @return string
* @access public
*/
function _generateSequenceKeyFunction($def)
{
//print_r($def);
//DB_DataObject::debugLevel(5);
global $_DB_DATAOBJECT;
// set the objects keys
$obj = new DB_DataObject();
$obj->_table = $this->table;
$obj->_database = $this->_database;
$obj->_database_dsn_md5 = $this->_database_dsn_md5;
// if the key is not an integer - then it's not a sequence or native
$_DB_DATAOBJECT['INI'][$obj->_database][$obj->__table] = $def['table'];
$_DB_DATAOBJECT['INI'][$obj->_database][$obj->__table . "__keys"] = $def['keys'];
$ar = $obj->sequenceKey();
//print_r($obj);
$ret = "\n" . " function sequenceKey() // keyname, use native, native name\n" . " {\n" . " return array(";
foreach ($ar as $v) {
switch (gettype($v)) {
case 'boolean':
$ret .= ($v ? 'true' : 'false') . ', ';
break;
case 'string':
$ret .= "'" . $v . "', ";
break;
default:
// eak
$ret .= "null, ";
}
}
$ret = preg_replace('#, $#', '', $ret);
return $ret . ");\n" . " }\n";
}