hedera-web/rest/edi/lib/section.php

28 lines
500 B
PHP
Raw Normal View History

<?php
2016-08-31 11:53:46 +00:00
namespace Edi;
require_once (__DIR__.'/segment.php');
class Section
{
var $name;
var $parent = NULL;
var $segments = [];
var $childs = [];
function getValue ($name, $key, $type = NULL, $subname = NULL)
{
foreach ($this->segments as $segment)
if ($segment->name == $name
&& (!$subname || $segment->values[1] == $subname))
return $segment->getValue ($key, $type);
if ($this->parent)
return $this->parent->getValue ($name, $key, $type, $subname);
return NULL;
}
}