public function addPage($page)
        {
            if ($page === $this) {
                throw new Exception('A page cannot have itself as a parent');
            }

            if (is_array($page)) {
                $page = Page::factory($page);
            } elseif (!$page instanceof Page) {
                throw new Exception('Invalid argument: $page must be an array');
            }

            $hash = $page->hashCode();

            if (array_key_exists($hash, $this->_index)) {
                // page is already in container
                return $this;
            }

            // adds page to container and sets dirty flag
            $this->_pages[$hash] = $page;
            $this->_index[$hash] = $page->getOrder();
            $this->_dirtyIndex = true;

            // inject self as page parent
            $page->setParent($this);

            return $this;
        }