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