landing page via php (blade)

This commit is contained in:
Arno Kaimbacher 2020-03-10 18:58:46 +01:00
parent a080faa91d
commit 43748471dc
9 changed files with 378 additions and 80 deletions

View file

@ -187,6 +187,11 @@ class Dataset extends Model
{
return $this->hasMany(Title::class, 'document_id', 'id');
}
public function mainTitle()
{
return $this->hasMany(Title::class, 'document_id', 'id')->where('type', 'Main')->first();
}
public function addMainTitle(Title $title)
{
@ -205,6 +210,10 @@ class Dataset extends Model
return $this->hasMany(Description::class, 'document_id', 'id');
}
public function mainAbstract()
{
return $this->hasMany(Description::class, 'document_id', 'id')->where('type', 'Abstract')->first();
}
public function addMainAbstract(Description $title)
{
$title->type = 'abstract';
@ -320,4 +329,15 @@ class Dataset extends Model
return 0;
}
}
public function geoLocation()
{
// return $this->coverage->x_min;
$geolocation =
'SOUTH-BOUND LATITUDE: ' . $this->coverage->x_min . ","
. ' * WEST-BOUND LONGITUDE: ' . $this->coverage->y_min . ","
. ' * NORTH-BOUND LATITUDE: ' . $this->coverage->x_max . ","
. ' * EAST-BOUND LONGITUDE: ' . $this->coverage->y_max;
return $geolocation;
}
}