eZ\Publish\Core\Persistence\Legacy\Content\Location\Gateway\DoctrineDatabase::unHideSubtree PHP Method

unHideSubtree() public method

If not make sure only children down to first hidden node is marked visible.
public unHideSubtree ( string $pathString )
$pathString string
    public function unHideSubtree($pathString)
    {
        // Unhide the requested node
        $query = $this->handler->createUpdateQuery();
        $query->update($this->handler->quoteTable('ezcontentobject_tree'))->set($this->handler->quoteColumn('is_hidden'), $query->bindValue(0))->where($query->expr->eq($this->handler->quoteColumn('path_string'), $query->bindValue($pathString)));
        $query->prepare()->execute();
        // Check if any parent nodes are explicitly hidden
        $query = $this->handler->createSelectQuery();
        $query->select($this->handler->quoteColumn('path_string'))->from($this->handler->quoteTable('ezcontentobject_tree'))->where($query->expr->lAnd($query->expr->eq($this->handler->quoteColumn('is_hidden'), $query->bindValue(1)), $query->expr->in($this->handler->quoteColumn('node_id'), array_filter(explode('/', $pathString)))));
        $statement = $query->prepare();
        $statement->execute();
        if (count($statement->fetchAll(\PDO::FETCH_COLUMN))) {
            // There are parent nodes set hidden, so that we can skip marking
            // something visible again.
            return;
        }
        // Find nodes of explicitly hidden subtrees in the subtree which
        // should be unhidden
        $query = $this->handler->createSelectQuery();
        $query->select($this->handler->quoteColumn('path_string'))->from($this->handler->quoteTable('ezcontentobject_tree'))->where($query->expr->lAnd($query->expr->eq($this->handler->quoteColumn('is_hidden'), $query->bindValue(1)), $query->expr->like($this->handler->quoteColumn('path_string'), $query->bindValue($pathString . '%'))));
        $statement = $query->prepare();
        $statement->execute();
        $hiddenSubtrees = $statement->fetchAll(\PDO::FETCH_COLUMN);
        $query = $this->handler->createUpdateQuery();
        $query->update($this->handler->quoteTable('ezcontentobject_tree'))->set($this->handler->quoteColumn('is_invisible'), $query->bindValue(0))->set($this->handler->quoteColumn('modified_subnode'), $query->bindValue(time()));
        // Build where expression selecting the nodes, which should be made
        // visible again
        $where = $query->expr->like($this->handler->quoteColumn('path_string'), $query->bindValue($pathString . '%'));
        if (count($hiddenSubtrees)) {
            $handler = $this->handler;
            $where = $query->expr->lAnd($where, $query->expr->lAnd(array_map(function ($pathString) use($query, $handler) {
                return $query->expr->not($query->expr->like($handler->quoteColumn('path_string'), $query->bindValue($pathString . '%')));
            }, $hiddenSubtrees)));
        }
        $query->where($where);
        $statement = $query->prepare()->execute();
    }