pasteAfter() public method

Paste one record after another record.
public pasteAfter ( string $command, array &$row, array $parameters, TYPO3\CMS\Core\DataHandling\DataHandler $tceMain ) : void
$command string The command which caused pasting - "copy" is targeted in order to determine "reference" pasting.
$row array The record to be pasted, by reference. Changes original $row
$parameters array List of parameters defining the paste operation target
$tceMain TYPO3\CMS\Core\DataHandling\DataHandler
return void
Esempio n. 1
0
 /**
  * Post-process a command executed on a record form the table this ConfigurationProvider
  * is attached to.
  *
  * @param string $command
  * @param integer $id
  * @param array $row
  * @param integer $relativeTo
  * @param DataHandler $reference
  * @return void
  */
 public function postProcessCommand($command, $id, array &$row, &$relativeTo, DataHandler $reference)
 {
     if (TRUE === self::shouldCallWithClassName(__CLASS__, __FUNCTION__, $id)) {
         parent::postProcessCommand($command, $id, $row, $relativeTo, $reference);
         $pasteCommands = array('copy', 'move');
         if (TRUE === in_array($command, $pasteCommands)) {
             $callback = $this->getCallbackCommand();
             if (TRUE === isset($callback['paste'])) {
                 $pasteCommand = $callback['paste'];
                 $parameters = explode('|', $pasteCommand);
                 $this->contentService->pasteAfter($command, $row, $parameters, $reference);
             } else {
                 $moveData = $this->getMoveData();
                 $this->contentService->moveRecord($row, $relativeTo, $moveData, $reference);
             }
         }
         self::trackMethodCallWithClassName(__CLASS__, __FUNCTION__, $id);
     }
 }