本文整理汇总了PHP中CustomField::getCustomColumnIndexes方法的典型用法代码示例。如果您正苦于以下问题:PHP CustomField::getCustomColumnIndexes方法的具体用法?PHP CustomField::getCustomColumnIndexes怎么用?PHP CustomField::getCustomColumnIndexes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CustomField
的用法示例。
在下文中一共展示了CustomField::getCustomColumnIndexes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addNewColumnToManagedTable
function addNewColumnToManagedTable()
{
$table = $this->getManagedTable();
// TODO: optimalizalni, hogy a getCustomColumnIndexes ne csinaljon annyi query-t minden esetben,
// ha tobbszor meghivjak (common field letrehozasanal):
if ($this->type != customfield_separator && !$this->isFixField() && !in_array($this->columnIndex, CustomField::getCustomColumnIndexes($this->getManagedTable()))) {
if (empty($this->userField)) {
executeQuery("ALTER TABLE @{$table} ADD {$this->columnIndex} TEXT NOT NULL;");
}
if ($table == "item" && !in_array($this->columnIndex, CustomField::getCustomColumnIndexes("search"))) {
executeQuery("ALTER TABLE @search ADD {$this->columnIndex} TEXT NOT NULL;");
$this->updateDefaultOfSelectionTypeFieldOfCustomList();
}
return TRUE;
}
return FALSE;
}
示例2: addCustomColumns
function addCustomColumns()
{
executeQuery("ALTER TABLE @search \n ADD `listTitle` varchar(255) NOT NULL default '',\n ADD `listDescription` TEXT NOT NULL,\n ADD `iid` int(11) NOT NULL,\n ADD `creationtime` datetime NOT NULL,\n ADD `creationtime_from` datetime NOT NULL,\n ADD `creationtime_to` datetime NOT NULL,\n ADD `status` int(11) NOT NULL default '-1',\n ADD `clicked` varchar(255) NOT NULL default '',\n ADD `responded` varchar(255) NOT NULL default '',\n ADD `title` varchar(255) NOT NULL default '',\n ADD `description` varchar(255) NOT NULL default '',\n ADD `ownerName` TEXT NOT NULL,\n ADD `expirationTime` datetime NOT NULL,\n ADD `expirationTime_from` datetime NOT NULL,\n ADD `expirationTime_to` datetime NOT NULL,\n ADD `primarySort` int(11) NOT NULL,\n ADD `primaryDir` varchar(4) NOT NULL default 'ASC',\n ADD `primaryPersistent` int(11) NOT NULL,\n ADD `secondarySort` int(11) NOT NULL,\n ADD `secondaryDir` varchar(4) NOT NULL default 'ASC',\n ADD `secondaryPersistent` int(11) NOT NULL,\n ADD `limit` varchar(10) NOT NULL,\n ADD `columns` TEXT NOT NULL,\n ADD `displayedFor` int(11) NOT NULL default '1',\n ADD `pages` TEXT NOT NULL,\n ADD `displayInMenu` int(11) NOT NULL,\n ADD `categorySpecific` int(11) NOT NULL,\n ADD `recursive`int(11) NOT NULL,\n ADD `listStyle` int(11) NOT NULL,\n ADD `loop` int(11) NOT NULL default 0,\n ADD `autoScroll` int(11) NOT NULL default 60,\n ADD `cache` int(11) NOT NULL default 60,\n ADD `positionNormal` varchar(10) NOT NULL,\n ADD `positionScrollable` varchar(10) NOT NULL,\n ADD `exportFields` TEXT NOT NULL,\n ADD `exportFormat` int(11) NOT NULL DEFAULT 1,\n ADD `xmlType` varchar(20) NOT NULL DEFAULT 'RSS2.0',\n ADD `customAdListTemplate` VARCHAR( 255 ) NOT NULL\n ");
$customSearchIndexes = CustomField::getCustomColumnIndexes("search");
$newIndexes = array();
foreach (CustomField::getCustomColumnIndexes("item") as $ci) {
if (!in_array($ci, $customSearchIndexes)) {
$newIndexes[] = $ci;
}
}
$pieces = array_map(create_function('$v', 'return "ADD $v TEXT NOT NULL";'), $newIndexes);
if (count($pieces)) {
executeQuery("ALTER TABLE @search " . implode(",", $pieces));
}
}