Skip to content

Commit

Permalink
Use type stored in db instead of hardcoding things.
Browse files Browse the repository at this point in the history
  • Loading branch information
michalstrzelecki committed Oct 13, 2017
1 parent 1e998b5 commit 0f9a80b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 25 deletions.
18 changes: 0 additions & 18 deletions src/Gzero/Core/Handler/Content/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,6 @@ class Category extends Content {
*/
protected $children;

/**
* @var
*/
protected $type;

/**
* Content constructor
*
* @param ContentRepository $contentRepo Content repository
* @param FileRepository $fileRepo File repository
* @param Request $request Request object
*/
public function __construct(ContentRepository $contentRepo, FileRepository $fileRepo, Request $request)
{
parent::__construct($contentRepo, $fileRepo, $request);
$this->type = 'category';
}

/**
* Load data from database
*
Expand Down
8 changes: 1 addition & 7 deletions src/Gzero/Core/Handler/Content/Content.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,6 @@ class Content implements ContentTypeHandler {
*/
protected $request;

/**
* @var
*/
protected $type;

/**
* Content constructor
*
Expand All @@ -80,7 +75,6 @@ public function __construct(ContentRepository $contentRepo, FileRepository $file
$this->fileRepo = $fileRepo;
$this->breadcrumbs = app('breadcrumbs');
$this->request = $request;
$this->type = 'content';
}

/**
Expand Down Expand Up @@ -140,7 +134,7 @@ protected function buildBreadcrumbsFromUrl($lang)
{
$url = (config('gzero.multilang.enabled')) ? '/' . $lang->code : '';
$this->breadcrumbs->register(
$this->type,
$this->content->type,
function ($breadcrumbs) use ($lang, $url) {
$breadcrumbs->push(trans('common.home'), $url);

Expand Down

0 comments on commit 0f9a80b

Please sign in to comment.