mirror of
https://github.com/Karaka-Management/oms-Calendar.git
synced 2026-02-16 08:28:42 +00:00
Unit test fixes
This commit is contained in:
parent
6323244d9e
commit
ea20567ec1
|
|
@ -15,6 +15,7 @@
|
||||||
*/
|
*/
|
||||||
namespace Modules\Calendar\Models;
|
namespace Modules\Calendar\Models;
|
||||||
|
|
||||||
|
use Modules\Calendar\Models\EventMapper;
|
||||||
use phpOMS\DataStorage\Database\DataMapperAbstract;
|
use phpOMS\DataStorage\Database\DataMapperAbstract;
|
||||||
use phpOMS\DataStorage\Database\Query\Builder;
|
use phpOMS\DataStorage\Database\Query\Builder;
|
||||||
use phpOMS\DataStorage\Database\Query\Column;
|
use phpOMS\DataStorage\Database\Query\Column;
|
||||||
|
|
@ -56,8 +57,8 @@ class CalendarMapper extends DataMapperAbstract
|
||||||
*/
|
*/
|
||||||
protected static $hasMany = [
|
protected static $hasMany = [
|
||||||
'events' => [
|
'events' => [
|
||||||
'mapper' => \Modules\Calendar\Models\EventMapper::class
|
'mapper' => EventMapper::class,
|
||||||
'relationmapper' => \Modules\Calendar\Models\EventMapper::class
|
'relationmapper' => EventMapper::class,
|
||||||
'table' => 'calendar_event',
|
'table' => 'calendar_event',
|
||||||
'dst' => 'calendar_event_calendar',
|
'dst' => 'calendar_event_calendar',
|
||||||
'src' => null,
|
'src' => null,
|
||||||
|
|
@ -121,8 +122,6 @@ class CalendarMapper extends DataMapperAbstract
|
||||||
|
|
||||||
$this->db->con->prepare($query->toSql())->execute();
|
$this->db->con->prepare($query->toSql())->execute();
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
var_dump($e->getMessage());
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -83,6 +83,16 @@ class Event
|
||||||
*/
|
*/
|
||||||
private $type = EventType::SINGLE;
|
private $type = EventType::SINGLE;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Event status.
|
||||||
|
*
|
||||||
|
* Active, inactive etc.
|
||||||
|
*
|
||||||
|
* @var int
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
private $status = EventStatus::ACTIVE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Schedule
|
* Schedule
|
||||||
*
|
*
|
||||||
|
|
@ -335,6 +345,17 @@ class Event
|
||||||
return $this->type;
|
return $this->type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return int
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||||
|
*/
|
||||||
|
public function getStatus() : int
|
||||||
|
{
|
||||||
|
return $this->status;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param int $calendar Calendar
|
* @param int $calendar Calendar
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ class EventMapper extends DataMapperAbstract
|
||||||
*/
|
*/
|
||||||
protected static $hasOne = [
|
protected static $hasOne = [
|
||||||
'schedule' => [
|
'schedule' => [
|
||||||
'mapper' => \Modules\Calendar\Models\ScheduleMapper::class,
|
'mapper' => ScheduleMapper::class,
|
||||||
'src' => 'calendar_event_schedule',
|
'src' => 'calendar_event_schedule',
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
|
||||||
34
Models/EventStatus.php
Normal file
34
Models/EventStatus.php
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Orange Management
|
||||||
|
*
|
||||||
|
* PHP Version 7.0
|
||||||
|
*
|
||||||
|
* @category TBD
|
||||||
|
* @package TBD
|
||||||
|
* @author OMS Development Team <dev@oms.com>
|
||||||
|
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||||
|
* @copyright 2013 Dennis Eichhorn
|
||||||
|
* @license OMS License 1.0
|
||||||
|
* @version 1.0.0
|
||||||
|
* @link http://orange-management.com
|
||||||
|
*/
|
||||||
|
namespace Modules\Calendar\Models;
|
||||||
|
|
||||||
|
use phpOMS\Datatypes\Enum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Event type enum.
|
||||||
|
*
|
||||||
|
* @category Calendar
|
||||||
|
* @package Modules
|
||||||
|
* @author OMS Development Team <dev@oms.com>
|
||||||
|
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||||
|
* @license OMS License 1.0
|
||||||
|
* @link http://orange-management.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
abstract class EventStatus extends Enum
|
||||||
|
{
|
||||||
|
const ACTIVE = 1;
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user