mirror of
https://github.com/Karaka-Management/oms-Calendar.git
synced 2026-02-17 17:08:42 +00:00
Fix #7
This commit is contained in:
parent
a70302d761
commit
3f979ac445
|
|
@ -46,18 +46,11 @@ class Installer extends InstallerAbstract
|
||||||
`calendar_name` varchar(255) NOT NULL,
|
`calendar_name` varchar(255) NOT NULL,
|
||||||
`calendar_password` varchar(255) DEFAULT NULL,
|
`calendar_password` varchar(255) DEFAULT NULL,
|
||||||
`calendar_description` varchar(255) NOT NULL,
|
`calendar_description` varchar(255) NOT NULL,
|
||||||
`calendar_created_by` int(11) NOT NULL,
|
|
||||||
`calendar_created_at` datetime NOT NULL,
|
`calendar_created_at` datetime NOT NULL,
|
||||||
PRIMARY KEY (`calendar_id`),
|
PRIMARY KEY (`calendar_id`)
|
||||||
KEY `calendar_created_by` (`calendar_created_by`)
|
|
||||||
)ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;'
|
)ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;'
|
||||||
)->execute();
|
)->execute();
|
||||||
|
|
||||||
$dbPool->get()->con->prepare(
|
|
||||||
'ALTER TABLE `' . $dbPool->get()->prefix . 'calendar`
|
|
||||||
ADD CONSTRAINT `' . $dbPool->get()->prefix . 'calendar_ibfk_1` FOREIGN KEY (`calendar_created_by`) REFERENCES `' . $dbPool->get()->prefix . 'account` (`account_id`);'
|
|
||||||
)->execute();
|
|
||||||
|
|
||||||
$dbPool->get()->con->prepare(
|
$dbPool->get()->con->prepare(
|
||||||
'CREATE TABLE if NOT EXISTS `' . $dbPool->get()->prefix . 'calendar_permission` (
|
'CREATE TABLE if NOT EXISTS `' . $dbPool->get()->prefix . 'calendar_permission` (
|
||||||
`calendar_permission_id` int(11) NOT NULL AUTO_INCREMENT,
|
`calendar_permission_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
|
|
|
||||||
|
|
@ -60,14 +60,6 @@ class Calendar
|
||||||
*/
|
*/
|
||||||
private $createdAt = null;
|
private $createdAt = null;
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by.
|
|
||||||
*
|
|
||||||
* @var int
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
private $createdBy = 0;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Current date of the calendar.
|
* Current date of the calendar.
|
||||||
*
|
*
|
||||||
|
|
@ -251,26 +243,6 @@ class Calendar
|
||||||
$this->createdAt = $createdAt;
|
$this->createdAt = $createdAt;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return int
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public function getCreatedBy() : int
|
|
||||||
{
|
|
||||||
return $this->createdBy;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param int $createdBy Creator
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public function setCreatedBy(int $createdBy)
|
|
||||||
{
|
|
||||||
$this->createdBy = $createdBy;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get current date
|
* Get current date
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,6 @@ class CalendarMapper extends DataMapperAbstract
|
||||||
'calendar_name' => ['name' => 'calendar_name', 'type' => 'string', 'internal' => 'name'],
|
'calendar_name' => ['name' => 'calendar_name', 'type' => 'string', 'internal' => 'name'],
|
||||||
'calendar_password' => ['name' => 'calendar_password', 'type' => 'string', 'internal' => 'password'],
|
'calendar_password' => ['name' => 'calendar_password', 'type' => 'string', 'internal' => 'password'],
|
||||||
'calendar_description' => ['name' => 'calendar_description', 'type' => 'string', 'internal' => 'description'],
|
'calendar_description' => ['name' => 'calendar_description', 'type' => 'string', 'internal' => 'description'],
|
||||||
'calendar_created_by' => ['name' => 'calendar_created_by', 'type' => 'int', 'internal' => 'createdBy'],
|
|
||||||
'calendar_created_at' => ['name' => 'calendar_created_at', 'type' => 'DateTime', 'internal' => 'createdAt'],
|
'calendar_created_at' => ['name' => 'calendar_created_at', 'type' => 'DateTime', 'internal' => 'createdAt'],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user