wip
This commit is contained in:
@ -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' );
|
||||
|
Reference in New Issue
Block a user