本文整理汇总了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";
}