copyPage() public method

Takes the input provided and runs the create method after stripping necessary fields.
public copyPage ( integer $fromPageId, array $input ) : DvsPage
$fromPageId integer
$input array
return DvsPage
Beispiel #1
0
 /**
  * Request the page be copied to another page (duplicated)
  *
  * @param  integer $id
  * @param  array   $input
  * @return Redirector
  */
 public function requestCopyPage($id, $input)
 {
     $page = $this->PageManager->copyPage($id, $input);
     if ($page) {
         return $this->Redirect->route('dvs-pages')->with('warnings', $this->PageManager->warnings)->with('message', $this->PageManager->message);
     }
     return $this->Redirect->route('dvs-pages-copy', $id)->withInput()->withErrors($this->PageManager->errors)->with('message', $this->PageManager->message);
 }