File: D:/HostingSpaces/SBogers10/rentman.komma.pro/app/Komma/Updates/Models/UpdateTranslation.php
<?php
namespace Komma\Updates\Models;
class UpdateTranslation extends \Komma\Kms\Updates\Models\UpdateTranslation
{
public $kmsClass = 'Komma\\Kms\\Updates\\Models\\UpdateTranslation';
public function rentmanUpdate()
{
return $this->belongsTo('Komma\Updates\Models\Update', 'update_id', 'id');
}
/**
* Get the route from the current translation
*
* @return Collection
*/
public function route()
{
/**
* On the Route model is an MorphTo relation
* By using a hasOne relation:
* where the routable_type is filled in with the KmsClass
* And the routable_id is set as the foreign_id,
* we can collect the route of the given model directly.
*
*/
return $this->hasOne('Komma\Routes\Models\Route', 'routable_id')
->where('routable_type', '=', $this->kmsClass);
}
}