本文整理汇总了PHP中Vtiger_Field::setTreeTemplate方法的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Field::setTreeTemplate方法的具体用法?PHP Vtiger_Field::setTreeTemplate怎么用?PHP Vtiger_Field::setTreeTemplate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vtiger_Field
的用法示例。
在下文中一共展示了Vtiger_Field::setTreeTemplate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: strval
/**
* Import Field of the module
* @access private
*/
function import_Field($blocknode, $blockInstance, $moduleInstance, $fieldnode)
{
$fieldInstance = new Vtiger_Field();
$fieldInstance->name = $fieldnode->fieldname;
$fieldInstance->label = $fieldnode->fieldlabel;
$fieldInstance->table = $fieldnode->tablename;
$fieldInstance->column = $fieldnode->columnname;
$fieldInstance->uitype = $fieldnode->uitype;
$fieldInstance->generatedtype = $fieldnode->generatedtype;
$fieldInstance->readonly = $fieldnode->readonly;
$fieldInstance->presence = $fieldnode->presence;
$fieldInstance->defaultvalue = $fieldnode->defaultvalue;
$fieldInstance->maximumlength = $fieldnode->maximumlength;
$fieldInstance->sequence = $fieldnode->sequence;
$fieldInstance->quickcreate = $fieldnode->quickcreate;
$fieldInstance->quicksequence = $fieldnode->quickcreatesequence;
$fieldInstance->typeofdata = $fieldnode->typeofdata;
$fieldInstance->displaytype = $fieldnode->displaytype;
$fieldInstance->info_type = $fieldnode->info_type;
if (!empty($fieldnode->fieldparams)) {
$fieldInstance->fieldparams = $fieldnode->fieldparams;
}
if (!empty($fieldnode->helpinfo)) {
$fieldInstance->helpinfo = $fieldnode->helpinfo;
}
if (isset($fieldnode->masseditable)) {
$fieldInstance->masseditable = $fieldnode->masseditable;
}
if (isset($fieldnode->columntype) && !empty($fieldnode->columntype)) {
$fieldInstance->columntype = strval($fieldnode->columntype);
}
if (!empty($fieldnode->tree_template)) {
$templateid = $fieldInstance->setTreeTemplate($fieldnode->tree_template, $moduleInstance);
$fieldInstance->fieldparams = $templateid;
}
$blockInstance->addField($fieldInstance);
// Set the field as entity identifier if marked.
if (!empty($fieldnode->entityidentifier)) {
$moduleInstance->entityidfield = $fieldnode->entityidentifier->entityidfield;
$moduleInstance->entityidcolumn = $fieldnode->entityidentifier->entityidcolumn;
$moduleInstance->setEntityIdentifier($fieldInstance);
}
// Check picklist values associated with field if any.
if (!empty($fieldnode->picklistvalues) && !empty($fieldnode->picklistvalues->picklistvalue)) {
$picklistvalues = array();
foreach ($fieldnode->picklistvalues->picklistvalue as $picklistvaluenode) {
$picklistvalues[] = $picklistvaluenode;
}
$fieldInstance->setPicklistValues($picklistvalues);
}
// Check related modules associated with this field
if (!empty($fieldnode->relatedmodules) && !empty($fieldnode->relatedmodules->relatedmodule)) {
$relatedmodules = array();
foreach ($fieldnode->relatedmodules->relatedmodule as $relatedmodulenode) {
$relatedmodules[] = $relatedmodulenode;
}
$fieldInstance->setRelatedModules($relatedmodules);
}
// Set summary field if marked in xml
if (!empty($fieldnode->summaryfield)) {
$fieldInstance->setSummaryField($fieldnode->summaryfield);
}
$this->__AddModuleFieldToCache($moduleInstance, $fieldnode->fieldname, $fieldInstance);
return $fieldInstance;
}