Contao\DC_Table::copyAll PHP Method

copyAll() public method

Move all selected records
public copyAll ( )
    public function copyAll()
    {
        if ($GLOBALS['TL_DCA'][$this->strTable]['config']['notCopyable']) {
            throw new InternalServerErrorException('Table "' . $this->strTable . '" is not copyable.');
        }
        /** @var SessionInterface $objSession */
        $objSession = \System::getContainer()->get('session');
        $arrClipboard = $objSession->get('CLIPBOARD');
        if (isset($arrClipboard[$this->strTable]) && is_array($arrClipboard[$this->strTable]['id'])) {
            foreach ($arrClipboard[$this->strTable]['id'] as $id) {
                $this->intId = $id;
                $id = $this->copy(true);
                \Input::setGet('pid', $id);
                \Input::setGet('mode', 1);
            }
        }
        $this->redirect($this->getReferer());
    }