public function onInitialize(ResourceEventInterface $event)
    {
        $page = $this->getPageFromEvent($event);

        $parent = $page->getParent();
        if ($parent && $parent->isLocked()) {
            throw new RuntimeException("Cannot create child page under a locked parent page.");
        }
    }
public function onInitialize(ResourceEventInterface $event)
    {
        $page = $this->getPageFromEvent($event);

        $parent = $page->getParent();
        if ($parent && $parent->isLocked()) {
            throw new RuntimeException("Cannot create child page under a locked parent page.");
        }
    }
public function onInitialize ( ResourceEventInterface $ event ) { $ page = $ this -> getPageFromEvent ( $ event ) ; $ parent = $ page -> getParent ( ) ; if ( $ parent && $ parent -> isLocked ( ) ) { throw new RuntimeException ( "Cannot create child page under a locked parent page." ) ; } }
Initialize event handler.

@param ResourceEventInterface $event
Initialize event handler .