public function push(RootlineElement $rootlineElement)
    {
        $lastElementIndex = max(0, (count($this->rootlineElements) - 1));

        if (!empty($this->rootlineElements[$lastElementIndex])) {
            if ($this->rootlineElements[$lastElementIndex]->getType() == RootlineElement::ELEMENT_TYPE_CONTENT) {
                throw new RootlineElementFormatException(
                    'Can not add an element to an Access Rootline whose\' last element is a content type element.',
                    1294422132
                );
            }

            if ($this->rootlineElements[$lastElementIndex]->getType() == RootlineElement::ELEMENT_TYPE_RECORD) {
                throw new RootlineElementFormatException(
                    'Can not add an element to an Access Rootline whose\' last element is a record type element.',
                    1308343423
                );
            }
        }

        $this->rootlineElements[] = $rootlineElement;
    }
public function push(RootlineElement $rootlineElement)
    {
        $lastElementIndex = max(0, (count($this->rootlineElements) - 1));

        if (!empty($this->rootlineElements[$lastElementIndex])) {
            if ($this->rootlineElements[$lastElementIndex]->getType() == RootlineElement::ELEMENT_TYPE_CONTENT) {
                throw new RootlineElementFormatException(
                    'Can not add an element to an Access Rootline whose\' last element is a content type element.',
                    1294422132
                );
            }

            if ($this->rootlineElements[$lastElementIndex]->getType() == RootlineElement::ELEMENT_TYPE_RECORD) {
                throw new RootlineElementFormatException(
                    'Can not add an element to an Access Rootline whose\' last element is a record type element.',
                    1308343423
                );
            }
        }

        $this->rootlineElements[] = $rootlineElement;
    }
public function push ( RootlineElement $ rootlineElement ) { $ lastElementIndex = max ( 0 , ( count ( $ this -> rootlineElements ) - 1 ) ) ; if ( ! empty ( $ this -> rootlineElements [ $ lastElementIndex ] ) ) { if ( $ this -> rootlineElements [ $ lastElementIndex ] -> getType ( ) == RootlineElement :: ELEMENT_TYPE_CONTENT ) { throw new RootlineElementFormatException ( 'Can not add an element to an Access Rootline whose\' last element is a content type element.' , 1294422132 ) ; } if ( $ this -> rootlineElements [ $ lastElementIndex ] -> getType ( ) == RootlineElement :: ELEMENT_TYPE_RECORD ) { throw new RootlineElementFormatException ( 'Can not add an element to an Access Rootline whose\' last element is a record type element.' , 1308343423 ) ; } } $ this -> rootlineElements [ ] = $ rootlineElement ; }
Adds an Access Rootline Element to the end of the rootline.

@param RootlineElement $rootlineElement Element to add.
Adds an Access Rootline Element to the end of the rootline .