protected function buildPagesClause()
    {
        $pages = $this->getPages();
        $pageIdField = ($this->type === 'pages') ? 'uid' : 'pid';

        return $pageIdField . ' IN(' . implode(',', $pages) . ')';
    }