This commit is contained in:
Joey Kimsey
2025-01-20 22:42:30 -05:00
parent 1d8d48e7c1
commit ca50450682
55 changed files with 1385 additions and 337 deletions

View File

@ -26,6 +26,8 @@ class Positions extends DatabaseModel {
[ 'start', 'varchar', '16' ],
[ 'end', 'varchar', '16' ],
[ 'details', 'text', '' ],
[ 'details_nobs', 'text', '' ],
[ 'image', 'varchar', '256' ],
];
public $plugin;
@ -37,17 +39,21 @@ class Positions extends DatabaseModel {
$this->plugin = new Plugin;
}
public function create( $name, $position, $start, $end, $details ) {
public function create( $name, $position, $start, $end, $details, $detailsNobs = '' ) {
if ( !$this->plugin->checkEnabled() ) {
Debug::info( 'Resume is disabled in the config.' );
return false;
}
if ( empty( $detailsNobs ) ) {
$detailsNobs = $details;
}
$fields = [
'name' => $name,
'position' => $position,
'start' => $start,
'end' => $end,
'details' => $details,
'details_nobs' => $detailsNobs,
];
if ( !self::$db->insert( $this->tableName, $fields ) ) {
Debug::info( 'Position::create - failed to insert to db' );