mirror of
https://github.com/Karaka-Management/oms-Calendar.git
synced 2026-02-01 09:18:43 +00:00
Unit test fixes
This commit is contained in:
parent
6323244d9e
commit
ea20567ec1
|
|
@ -15,6 +15,7 @@
|
|||
*/
|
||||
namespace Modules\Calendar\Models;
|
||||
|
||||
use Modules\Calendar\Models\EventMapper;
|
||||
use phpOMS\DataStorage\Database\DataMapperAbstract;
|
||||
use phpOMS\DataStorage\Database\Query\Builder;
|
||||
use phpOMS\DataStorage\Database\Query\Column;
|
||||
|
|
@ -56,8 +57,8 @@ class CalendarMapper extends DataMapperAbstract
|
|||
*/
|
||||
protected static $hasMany = [
|
||||
'events' => [
|
||||
'mapper' => \Modules\Calendar\Models\EventMapper::class
|
||||
'relationmapper' => \Modules\Calendar\Models\EventMapper::class
|
||||
'mapper' => EventMapper::class,
|
||||
'relationmapper' => EventMapper::class,
|
||||
'table' => 'calendar_event',
|
||||
'dst' => 'calendar_event_calendar',
|
||||
'src' => null,
|
||||
|
|
@ -121,8 +122,6 @@ class CalendarMapper extends DataMapperAbstract
|
|||
|
||||
$this->db->con->prepare($query->toSql())->execute();
|
||||
} catch (\Exception $e) {
|
||||
var_dump($e->getMessage());
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -83,6 +83,16 @@ class Event
|
|||
*/
|
||||
private $type = EventType::SINGLE;
|
||||
|
||||
/**
|
||||
* Event status.
|
||||
*
|
||||
* Active, inactive etc.
|
||||
*
|
||||
* @var int
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private $status = EventStatus::ACTIVE;
|
||||
|
||||
/**
|
||||
* Schedule
|
||||
*
|
||||
|
|
@ -335,6 +345,17 @@ class Event
|
|||
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
|
||||
*
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ class EventMapper extends DataMapperAbstract
|
|||
*/
|
||||
protected static $hasOne = [
|
||||
'schedule' => [
|
||||
'mapper' => \Modules\Calendar\Models\ScheduleMapper::class,
|
||||
'mapper' => ScheduleMapper::class,
|
||||
'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