<?php

namespace Eurostop\Products;

class ArrayOfSubmittedHierarchyNodeAction implements \ArrayAccess, \Iterator, \Countable
{

    /**
     * @var SubmittedHierarchyNodeAction[] $SubmittedHierarchyNodeAction
     */
    protected $SubmittedHierarchyNodeAction = null;

    
    public function __construct()
    {
    
    }

    /**
     * @return SubmittedHierarchyNodeAction[]
     */
    public function getSubmittedHierarchyNodeAction()
    {
      return $this->SubmittedHierarchyNodeAction;
    }

    /**
     * @param SubmittedHierarchyNodeAction[] $SubmittedHierarchyNodeAction
     * @return \Eurostop\Products\ArrayOfSubmittedHierarchyNodeAction
     */
    public function setSubmittedHierarchyNodeAction(array $SubmittedHierarchyNodeAction = null)
    {
      $this->SubmittedHierarchyNodeAction = $SubmittedHierarchyNodeAction;
      return $this;
    }

    /**
     * ArrayAccess implementation
     *
     * @param mixed $offset An offset to check for
     * @return boolean true on success or false on failure
     */
    public function offsetExists($offset)
    {
      return isset($this->SubmittedHierarchyNodeAction[$offset]);
    }

    /**
     * ArrayAccess implementation
     *
     * @param mixed $offset The offset to retrieve
     * @return SubmittedHierarchyNodeAction
     */
    public function offsetGet($offset)
    {
      return $this->SubmittedHierarchyNodeAction[$offset];
    }

    /**
     * ArrayAccess implementation
     *
     * @param mixed $offset The offset to assign the value to
     * @param SubmittedHierarchyNodeAction $value The value to set
     * @return void
     */
    public function offsetSet($offset, $value)
    {
      if (!isset($offset)) {
        $this->SubmittedHierarchyNodeAction[] = $value;
      } else {
        $this->SubmittedHierarchyNodeAction[$offset] = $value;
      }
    }

    /**
     * ArrayAccess implementation
     *
     * @param mixed $offset The offset to unset
     * @return void
     */
    public function offsetUnset($offset)
    {
      unset($this->SubmittedHierarchyNodeAction[$offset]);
    }

    /**
     * Iterator implementation
     *
     * @return SubmittedHierarchyNodeAction Return the current element
     */
    public function current()
    {
      return current($this->SubmittedHierarchyNodeAction);
    }

    /**
     * Iterator implementation
     * Move forward to next element
     *
     * @return void
     */
    public function next()
    {
      next($this->SubmittedHierarchyNodeAction);
    }

    /**
     * Iterator implementation
     *
     * @return string|null Return the key of the current element or null
     */
    public function key()
    {
      return key($this->SubmittedHierarchyNodeAction);
    }

    /**
     * Iterator implementation
     *
     * @return boolean Return the validity of the current position
     */
    public function valid()
    {
      return $this->key() !== null;
    }

    /**
     * Iterator implementation
     * Rewind the Iterator to the first element
     *
     * @return void
     */
    public function rewind()
    {
      reset($this->SubmittedHierarchyNodeAction);
    }

    /**
     * Countable implementation
     *
     * @return SubmittedHierarchyNodeAction Return count of elements
     */
    public function count()
    {
      return count($this->SubmittedHierarchyNodeAction);
    }

}
