<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">&lt;?php

namespace WsdlToPhp\PackageBase;

abstract class AbstractStructArrayBase extends AbstractStructBase implements StructArrayInterface
{
    /**
     * Array that contains values when only one parameter is set when calling __construct method
     * @var array
     */
    protected $internArray;
    /**
     * Bool that tells if array is set or not
     * @var bool
     */
    protected $internArrayIsArray;
    /**
     * Items index browser
     * @var int
     */
    protected $internArrayOffset;
    /**
     * Method alias to count
     * @uses AbstractStructArrayBase::count()
     * @return int
     */
    public function length()
    {
        return $this-&gt;count();
    }
    /**
     * Method returning item length, alias to length
     * @uses AbstractStructArrayBase::getInternArray()
     * @uses AbstractStructArrayBase::getInternArrayIsArray()
     * @return int
     */
    public function count()
    {
        return $this-&gt;getInternArrayIsArray() ? count($this-&gt;getInternArray()) : -1;
    }
    /**
     * Method returning the current element
     * @uses AbstractStructArrayBase::offsetGet()
     * @return mixed
     */
    public function current()
    {
        return $this-&gt;offsetGet($this-&gt;internArrayOffset);
    }
    /**
     * Method moving the current position to the next element
     * @uses AbstractStructArrayBase::getInternArrayOffset()
     * @uses AbstractStructArrayBase::setInternArrayOffset()
     * @return AbstractStructArrayBase
     */
    public function next()
    {
        return $this-&gt;setInternArrayOffset($this-&gt;getInternArrayOffset() + 1);
    }
    /**
     * Method resetting itemOffset
     * @uses AbstractStructArrayBase::setInternArrayOffset()
     * @return int
     */
    public function rewind()
    {
        return $this-&gt;setInternArrayOffset(0);
    }
    /**
     * Method checking if current itemOffset points to an existing item
     * @uses AbstractStructArrayBase::getInternArrayOffset()
     * @uses AbstractStructArrayBase::offsetExists()
     * @return bool
     */
    public function valid()
    {
        return $this-&gt;offsetExists($this-&gt;getInternArrayOffset());
    }
    /**
     * Method returning current itemOffset value, alias to getInternArrayOffset
     * @uses AbstractStructArrayBase::getInternArrayOffset()
     * @return int
     */
    public function key()
    {
        return $this-&gt;getInternArrayOffset();
    }
    /**
     * Method alias to offsetGet
     * @see AbstractStructArrayBase::offsetGet()
     * @uses AbstractStructArrayBase::offsetGet()
     * @param int $index
     * @return mixed
     */
    public function item($index)
    {
        return $this-&gt;offsetGet($index);
    }
    /**
     * Default method adding item to array
     * @uses AbstractStructArrayBase::getAttributeName()
     * @uses AbstractStructArrayBase::__toString()
     * @uses AbstractStructArrayBase::_set()
     * @uses AbstractStructArrayBase::_get()
     * @uses AbstractStructArrayBase::setInternArray()
     * @uses AbstractStructArrayBase::setInternArrayIsArray()
     * @uses AbstractStructArrayBase::setInternArrayOffset()
     * @param mixed $item value
     * @return AbstractStructArrayBase
     */
    public function add($item)
    {
        // init array
        if (!is_array($this-&gt;_get($this-&gt;getAttributeName()))) {
            $this-&gt;_set($this-&gt;getAttributeName(), []);
        }
        // current array
        $currentArray = $this-&gt;_get($this-&gt;getAttributeName());
        array_push($currentArray, $item);
        $this
            -&gt;_set($this-&gt;getAttributeName(), $currentArray)
            -&gt;setInternArray($currentArray)
            -&gt;setInternArrayIsArray(true)
            -&gt;setInternArrayOffset(0);
        return $this;
    }
    /**
     * Method returning the first item
     * @uses AbstractStructArrayBase::item()
     * @return mixed
     */
    public function first()
    {
        return $this-&gt;item(0);
    }
    /**
     * Method returning the last item
     * @uses AbstractStructArrayBase::item()
     * @uses AbstractStructArrayBase::length()
     * @return mixed
     */
    public function last()
    {
        return $this-&gt;item($this-&gt;length() - 1);
    }
    /**
     * Method testing index in item
     * @uses AbstractStructArrayBase::getInternArrayIsArray()
     * @uses AbstractStructArrayBase::getInternArray()
     * @param int $offset
     * @return bool
     */
    public function offsetExists($offset)
    {
        return ($this-&gt;getInternArrayIsArray() &amp;&amp; array_key_exists($offset, $this-&gt;getInternArray()));
    }
    /**
     * Method returning the item at "index" value
     * @uses AbstractStructArrayBase::offsetExists()
     * @param int $offset
     * @return mixed
     */
    public function offsetGet($offset)
    {
        return $this-&gt;offsetExists($offset) ? $this-&gt;internArray[$offset] : null;
    }
    /**
     * Method setting value at offset
     * @param mixed $offset
     * @param mixed $value
     * @return AbstractStructArrayBase
     */
    public function offsetSet($offset, $value)
    {
        $this-&gt;internArray[$offset] = $value;
        return $this-&gt;_set($this-&gt;getAttributeName(), $this-&gt;internArray);
    }
    /**
     * Method unsetting value at offset
     * @param mixed $offset
     * @return AbstractStructArrayBase
     */
    public function offsetUnset($offset)
    {
        if ($this-&gt;offsetExists($offset)) {
            unset($this-&gt;internArray[$offset]);
            $this-&gt;_set($this-&gt;getAttributeName(), $this-&gt;internArray);
        }
        return $this;
    }
    /**
     * Method returning intern array to iterate trough
     * @return array
     */
    public function getInternArray()
    {
        @trigger_error(sprintf('%s() will be private in WsdlToPhp/PackageBase 5.0.', __METHOD__), E_USER_DEPRECATED);

        return $this-&gt;internArray;
    }
    /**
     * Method setting intern array to iterate trough
     * @param array $internArray
     * @return AbstractStructArrayBase
     */
    public function setInternArray($internArray)
    {
        @trigger_error(sprintf('%s() will be private in WsdlToPhp/PackageBase 5.0.', __METHOD__), E_USER_DEPRECATED);

        $this-&gt;internArray = $internArray;
        return $this;
    }
    /**
     * Method returnint intern array index when iterating trough
     * @return int
     */
    public function getInternArrayOffset()
    {
        @trigger_error(sprintf('%s() will be private in WsdlToPhp/PackageBase 5.0.', __METHOD__), E_USER_DEPRECATED);

        return $this-&gt;internArrayOffset;
    }
    /**
     * Method initiating internArray
     * @uses AbstractStructArrayBase::setInternArray()
     * @uses AbstractStructArrayBase::setInternArrayOffset()
     * @uses AbstractStructArrayBase::setInternArrayIsArray()
     * @uses AbstractStructArrayBase::getAttributeName()
     * @uses AbstractStructArrayBase::initInternArray()
     * @uses AbstractStructArrayBase::__toString()
     * @param array $array the array to iterate trough
     * @param bool $internCall indicates that methods is calling itself
     * @return AbstractStructArrayBase
     */
    public function initInternArray($array = [], $internCall = false)
    {
        @trigger_error(sprintf('%s() will be private in WsdlToPhp/PackageBase 5.0.', __METHOD__), E_USER_DEPRECATED);

        if (is_array($array) &amp;&amp; count($array) &gt; 0) {
            $this
                -&gt;setInternArray($array)
                -&gt;setInternArrayOffset(0)
                -&gt;setInternArrayIsArray(true);
        } elseif (!$internCall &amp;&amp; property_exists($this, $this-&gt;getAttributeName())) {
            $this-&gt;initInternArray($this-&gt;_get($this-&gt;getAttributeName()), true);
        }
        return $this;
    }
    /**
     * Method setting intern array offset when iterating trough
     * @param int $internArrayOffset
     * @return AbstractStructArrayBase
     */
    public function setInternArrayOffset($internArrayOffset)
    {
        @trigger_error(sprintf('%s() will be private in WsdlToPhp/PackageBase 5.0.', __METHOD__), E_USER_DEPRECATED);

        $this-&gt;internArrayOffset = $internArrayOffset;
        return $this;
    }
    /**
     * Method returning true if intern array is an actual array
     * @return bool
     */
    public function getInternArrayIsArray()
    {
        @trigger_error(sprintf('%s() will be private in WsdlToPhp/PackageBase 5.0.', __METHOD__), E_USER_DEPRECATED);

        return $this-&gt;internArrayIsArray;
    }
    /**
     * Method setting if intern array is an actual array
     * @param bool $internArrayIsArray
     * @return AbstractStructArrayBase
     */
    public function setInternArrayIsArray($internArrayIsArray = false)
    {
        @trigger_error(sprintf('%s() will be private in WsdlToPhp/PackageBase 5.0.', __METHOD__), E_USER_DEPRECATED);

        $this-&gt;internArrayIsArray = $internArrayIsArray;
        return $this;
    }
}
</pre></body></html>