Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issue where the wrong presenter was being passed back
- Loading branch information
1 parent
d58cf22
commit 34418da
Showing
2 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php namespace Anomaly\PreferencesModule\Preference\Command; | ||
|
||
use Anomaly\PreferencesModule\Preference\Contract\PreferenceRepositoryInterface; | ||
use Illuminate\Contracts\Bus\SelfHandling; | ||
|
||
/** | ||
* Class GetPreference | ||
* | ||
* @link http://pyrocms.com/ | ||
* @author PyroCMS, Inc. <support@pyrocms.com> | ||
* @author Ryan Thompson <ryan@pyrocms.com> | ||
* @package Anomaly\PreferencesModule\Preference\Command | ||
*/ | ||
class GetPreference implements SelfHandling | ||
{ | ||
|
||
/** | ||
* The preference key. | ||
* | ||
* @var string | ||
*/ | ||
protected $key; | ||
|
||
/** | ||
* Create a new GetPreference instance. | ||
* | ||
* @param $key | ||
* @param null $default | ||
*/ | ||
public function __construct($key) | ||
{ | ||
$this->key = $key; | ||
} | ||
|
||
/** | ||
* Handle the command. | ||
* | ||
* @param PreferenceRepositoryInterface $preferences | ||
* @return mixed | ||
*/ | ||
public function handle(PreferenceRepositoryInterface $preferences) | ||
{ | ||
return $preferences->get($this->key); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters