本文整理汇总了PHP中Field::toDoc方法的典型用法代码示例。如果您正苦于以下问题:PHP Field::toDoc方法的具体用法?PHP Field::toDoc怎么用?PHP Field::toDoc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Field
的用法示例。
在下文中一共展示了Field::toDoc方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: toDoc
public function toDoc()
{
$temp = $this->{'joinable-sections'};
$this->{'joinable-sections'} = array();
$doc = parent::toDoc();
$doc->formatOutput = true;
$parent = $doc->xpath('/field/joinable-sections')->item(0);
$this->{'joinable-sections'} = $temp;
foreach ($this->{'joinable-sections'} as $section) {
$item = $doc->createElement('item');
$item->setValue($section);
$parent->appendChild($item);
}
return $doc;
}
示例2: toDoc
public function toDoc()
{
$suggestion_list_source = NULL;
if (isset($this->properties->{'suggestion-list-source'}) && is_array($this->properties->{'suggestion-list-source'})) {
$suggestion_list_source = $this->properties->{'suggestion-list-source'};
}
unset($this->properties->{'suggestion-list-source'});
$include_existing = $this->{'suggestion-list-include-existing'} == true ? 'yes' : 'no';
unset($this->properties->{'suggestion-list-include-existing'});
$doc = parent::toDoc();
$this->properties->{'suggestion-list-include-existing'} = $include_existing;
$this->properties->{'suggestion-list-source'} = $suggestion_list_source;
if (!is_null($suggestion_list_source)) {
$element = $doc->createElement('suggestion-list-source');
$element->setAttribute('include-existing', $include_existing);
foreach ($suggestion_list_source as $key => $value) {
list($section, $field) = $value;
$item = $doc->createElement('item');
$item->setAttributeArray(array('section' => $section, 'field' => $field));
$element->appendChild($item);
}
$doc->documentElement->appendChild($element);
}
return $doc;
}
示例3: toDoc
public function toDoc()
{
$related_fields = NULL;
if (isset($this->properties->{'related-fields'}) && is_array($this->properties->{'related-fields'})) {
$related_fields = $this->properties->{'related-fields'};
}
unset($this->properties->{'related-fields'});
$doc = parent::toDoc();
$this->properties->{'related-fields'} = $related_fields;
if (!is_null($related_fields)) {
$element = $doc->createElement('related-fields');
foreach ($related_fields as $key => $value) {
list($section, $field) = $value;
$item = $doc->createElement('item');
$item->setAttributeArray(array('section' => $section, 'field' => $field));
$element->appendChild($item);
}
$doc->documentElement->appendChild($element);
}
return $doc;
}