Airship\Cabin\Bridge\Landing\PageManager::processDeletePage PHP Method

processDeletePage() protected method

Confirm deletion
protected processDeletePage ( integer $pageId, array $post = [], string $cabin = '', string $dir = '' ) : boolean
$pageId integer
$post array
$cabin string
$dir string
return boolean
    protected function processDeletePage(int $pageId, array $post = [], string $cabin = '', string $dir = '') : bool
    {
        $this->log('Attempting to delete a page', LogLevel::ALERT, ['pageId' => $pageId, 'cabin' => $cabin, 'dir' => $dir]);
        list($oldCabin, $oldPath, $oldURL) = $this->pg->getPathByPageId((int) $pageId, $cabin);
        if ($this->pg->deletePage($pageId)) {
            if (!empty($post['create_redirect']) && !empty($post['redirect_to'])) {
                $this->pg->createSameCabinRedirect($oldPath . '/' . $oldURL, $post['redirect_to'], $oldCabin);
            }
            \Airship\redirect($this->airship_cabin_prefix . '/pages/' . $cabin, ['dir' => $dir]);
        }
        return false;
    }