add keywords during publishing
This commit is contained in:
parent
f3f17d9371
commit
d9b26afb3f
13 changed files with 332 additions and 96 deletions
|
@ -194,6 +194,11 @@ class Dataset extends Model
|
|||
return $this->hasMany(\App\Models\DatasetReference::class, 'document_id', 'id');
|
||||
}
|
||||
|
||||
public function subjects()
|
||||
{
|
||||
return $this->hasMany(\App\Models\Subject::class, 'document_id', 'id');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the xml-cache record associated with the dataset.
|
||||
|
|
19
app/Models/Subject.php
Normal file
19
app/Models/Subject.php
Normal file
|
@ -0,0 +1,19 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use App\Models\Dataset;
|
||||
|
||||
class Subject extends Model
|
||||
{
|
||||
protected $table = 'document_subjects';
|
||||
public $timestamps = false;
|
||||
|
||||
protected $fillable = ['value', 'type'];
|
||||
|
||||
public function dataset()
|
||||
{
|
||||
return $this->belongsTo(Dataset::class, 'document_id', 'id');
|
||||
}
|
||||
}
|
|
@ -14,7 +14,7 @@ class XmlCache extends Model
|
|||
* @var string
|
||||
*/
|
||||
protected $table = 'document_xml_cache';
|
||||
public $timestamps = false;
|
||||
public $timestamps = false;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -56,14 +56,13 @@ class XmlCache extends Model
|
|||
}
|
||||
|
||||
/**
|
||||
* Check if a document in a specific xml version is already cached or not.
|
||||
* Check if a dataset in a specific xml version is already cached or not.
|
||||
*
|
||||
* @param mixed $datasetId
|
||||
* @param mixed $xmlVersion
|
||||
* @param mixed $serverDateModified
|
||||
* @return bool Returns true on cached hit else false.
|
||||
*/
|
||||
public function hasValidEntry($datasetId, $serverDateModified)
|
||||
public function hasValidEntry($datasetId, $serverDateModified) : bool
|
||||
{
|
||||
$select = DB::table('document_xml_cache');
|
||||
$select->where('document_id', '=', $datasetId)
|
||||
|
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue