本文整理汇总了PHP中Field::setTag方法的典型用法代码示例。如果您正苦于以下问题:PHP Field::setTag方法的具体用法?PHP Field::setTag怎么用?PHP Field::setTag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Field
的用法示例。
在下文中一共展示了Field::setTag方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: unserializeFromString
function unserializeFromString($rawxml)
{
$xml_parser = xml_parser_create();
xml_parse_into_struct($xml_parser, $rawxml, $vector, $indice);
xml_parser_free($xml_parser);
$buffer = "";
for ($i = 0; $i < sizeof($vector); $i++) {
if ($vector[$i]["tag"] == "RECORD" && $vector[$i]["type"] == "open") {
$this->setMfn($vector[$i][attributes]["MFN"]);
}
if ($vector[$i]["tag"] == "FIELD" && $vector[$i]["type"] == "complete") {
$campo = new Field();
if ($vector[$i][attributes]["TAG"] != "") {
$campo->setTag($vector[$i][attributes]["TAG"]);
$campo->setContent($vector[$i]["value"]);
$this->addField($campo);
}
//echo "<field tag=\"". $vector[$i][attributes]["TAG"]."\"><occ>".$vector[$i]["value"]."</occ></field>\n";
}
if ($vector[$i]["tag"] == "FIELD" && $vector[$i]["type"] == "open") {
$campo = new Field();
if ($vector[$i][attributes]["TAG"] != "") {
$campo->setTag($vector[$i][attributes]["TAG"]);
$campo->setContent(str_replace("\r", "", str_replace("\n", "", trim($vector[$i]["value"]))));
}
//$buffer="<field tag=\"". $vector[$i][attributes]["TAG"]."\"><occ>".;
}
if ($vector[$i]["tag"] == "SUBFIELD" && $vector[$i]["type"] == "complete") {
$subcampo = new Subfield();
$subcampo->setLetra($vector[$i][attributes]["ID"]);
$subcampo->setContent($vector[$i]["value"]);
$campo->addSubField($subcampo);
//$buffer.="^".$vector[$i][attributes]["ID"].trim(trim($vector[$i]["value"],"\r"),"\n");
}
if ($vector[$i]["tag"] == "FIELD" && $vector[$i]["type"] == "close") {
$this->addField($campo);
//$buffer .= "</occ></field>\n";
//echo $buffer;
}
}
}
示例2: Field
function define_field($tag, $content)
{
$field = new Field();
$field->setTag($tag);
$field->setContent($content);
$this->registro->addField($field);
}
示例3: defineField
function defineField($tag, $content)
{
$field = new Field();
if ($content == "") {
$content == "vazio";
}
$content = utf8_encode($content);
$field->setTag($tag);
$field->setContent($content);
$this->registro->addField($field, false);
}
示例4: defineField
function defineField($tag, $content)
{
$field = new Field();
//$content = utf8_encode($content);
$field->setTag($tag);
$field->setContent($content);
$this->registro->addField($field, true);
}
示例5: defineField
function defineField($tag, $content)
{
if (isset($content) && $content != "") {
$field = new Field();
$content = utf8_encode($content);
$field->setTag($tag);
$field->setContent($content);
$this->registro->addField($field, false);
}
}