implement copying a complete Seminary (implements issue #7)
This commit is contained in:
parent
a7a4652a0e
commit
b2d00bc624
31 changed files with 2151 additions and 157 deletions
79
app/exceptions/FileCopyException.inc
Normal file
79
app/exceptions/FileCopyException.inc
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* The Legend of Z
|
||||
*
|
||||
* @author Oliver Hanraths <oliver.hanraths@uni-duesseldorf.de>
|
||||
* @copyright 2014 Heinrich-Heine-Universität Düsseldorf
|
||||
* @license http://www.gnu.org/licenses/gpl.html
|
||||
* @link https://bitbucket.org/coderkun/the-legend-of-z
|
||||
*/
|
||||
|
||||
namespace hhu\z\exceptions;
|
||||
|
||||
|
||||
/**
|
||||
* Exception: File copy went wrong
|
||||
*
|
||||
* @author Oliver Hanraths <oliver.hanraths@uni-duesseldorf.de>
|
||||
*/
|
||||
class FileCopyException extends \nre\core\Exception
|
||||
{
|
||||
/**
|
||||
* Error code
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
const CODE = 204;
|
||||
/**
|
||||
* Error message
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const MESSAGE = 'File copy went wrong';
|
||||
|
||||
/**
|
||||
* Nested error
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $nestedError;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Construct a new exception.
|
||||
*
|
||||
* @param array $nestedError Nested error
|
||||
* @param string $message Error message
|
||||
* @param int $code Error code
|
||||
*/
|
||||
function __construct($nestedError, $message=self::MESSAGE, $code=self::CODE)
|
||||
{
|
||||
parent::__construct(
|
||||
$message,
|
||||
$code,
|
||||
$nestedError['message']
|
||||
);
|
||||
|
||||
// Store values
|
||||
$this->nestedError = $nestedError;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get nested error.
|
||||
*
|
||||
* @return Nested error
|
||||
*/
|
||||
public function getNestedError()
|
||||
{
|
||||
return $this->nestedError;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
@ -22,7 +22,18 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Copy a Quest.
|
||||
*
|
||||
* @param int $userId ID of creating user
|
||||
* @param int $sourceQuestId ID of Quest to copy from
|
||||
* @param int $targetQuestId ID of Quest to copy to
|
||||
* @param int $seminaryMediaIds Mapping of SeminaryMedia-IDs from source Seminary to targetSeminary
|
||||
*/
|
||||
public abstract function copyQuest($userId, $sourceQuestId, $targetQuestId, $seminaryMediaIds);
|
||||
|
||||
|
||||
/**
|
||||
* Load a Model.
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue