本文整理汇总了PHP中CustomField::getNextColumnIndex方法的典型用法代码示例。如果您正苦于以下问题:PHP CustomField::getNextColumnIndex方法的具体用法?PHP CustomField::getNextColumnIndex怎么用?PHP CustomField::getNextColumnIndex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CustomField
的用法示例。
在下文中一共展示了CustomField::getNextColumnIndex方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addCustomColumns
function addCustomColumns($table)
{
global ${"{$table}_typ"};
static $maxColumnIndex = 0;
// hogy a load a custom fieldeket is betoltse az objektumba:
//$customColumnIndexes or $customColumnIndexes = self::getCustomColumnIndexes($table);
$maxColumnIndex or $maxColumnIndex = CustomField::getNextColumnIndex() - 1;
//foreach( $customColumnIndexes as $columnIndex )
//{
// if( !isset(${"{$table}_typ"}["attributes"][$columnIndex]) ) ${"{$table}_typ"}["attributes"][$columnIndex]=array("type"=>"TEXT");
//}
for ($i = 0; $i <= $maxColumnIndex; $i++) {
if (!isset(${"{$table}_typ"}["attributes"]["col_{$i}"])) {
${"{$table}_typ"}["attributes"]["col_{$i}"] = array("type" => "TEXT");
}
}
}
示例2: modify
function modify()
{
list($oldIsCommon, $oldName, $oldColumnIndex, $this->userField) = G::getAttr($this->id, "customfield", "isCommon", "name", "columnIndex", "userField");
// ha most allitjuk common-ra, uj columnIndex kell:
if (!$oldIsCommon && $this->isCommon) {
if ($this->commonFieldAlreadyExists()) {
return;
}
$this->columnIndex = "col_" . CustomField::getNextColumnIndex();
}
parent::modify();
if (!Roll::isFormInvalid() && !$this->isFixField()) {
if ($oldIsCommon != $this->isCommon) {
if ($this->isCommon) {
load($this);
$newColumnAdded = $this->addNewColumnToManagedTable();
// az item tablaban minden erteket atmasolunk a regi columnIndexrol az ujba:
if ($newColumnAdded) {
executeQuery("UPDATE @item SET {$this->columnIndex}={$oldColumnIndex}, {$oldColumnIndex}='' WHERE cid=#cid#", $this->cid);
$this->updatePictureNames($oldColumnIndex, $this->cid);
}
// TODO: a customlistek search felteteleinek update-ezese!
$this->nextAction =& new AppController("field/sortfield_form/{$this->cid}");
$this->propagateCommonField();
} else {
// a globalis common torlese:
executeQuery("DELETE FROM @customfield WHERE cid=0 AND isCommon=1 AND columnIndex=#ci#", $this->columnIndex);
// az osszes tobbi kategoriaban atallitjuk ezt a field-et unique-ra:
executeQuery("UPDATE @customfield SET isCommon=0 WHERE cid!=#cid# AND isCommon=1 AND columnIndex=#ci#", $this->cid, $this->columnIndex);
}
} elseif ($this->isCommon && $oldName != $this->name) {
executeQuery("UPDATE @customfield SET name=#name# WHERE cid!=#cid# AND isCommon=1 AND columnIndex=#ci#", $this->name, $this->cid, $this->columnIndex);
}
}
if (!Roll::isFormInvalid()) {
CacheManager::resetAllCache();
}
}