File: D:/HostingSpaces/SBogers85/dale-int.com/app/Komma/Projects/Models/ProjectTranslation.php
<?php
/**
* Short description for the file.
*
* @author Komma <support@komma.pro>
* @copyright (c) 2012-2015, Komma Mediadesign
*/
namespace Komma\Projects\Models;
class ProjectTranslation extends \Komma\Kms\Projects\Models\ProjectTranslation
{
public $kmsClass = 'Komma\\Kms\\Projects\\Models\\ProjectTranslation';
/**
* 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);
;
}
}