Skip to content

Commit

Permalink
Merge pull request #3 from boite/master
Browse files Browse the repository at this point in the history
Add Service.getKeyPrefix() to complement the existing setKeyPrefix method
  • Loading branch information
joostfaassen committed Oct 30, 2018
2 parents af4fa83 + 08ac3d0 commit e363dd8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Service.php
Expand Up @@ -7,18 +7,23 @@
class Service
{
private $storageadapter;
private $prefix;
private $prefix = '';

public function __construct($storageadapter)
{
$this->storageadapter = $storageadapter;
}

public function setKeyPrefix($prefix)
{
$this->prefix = $prefix;
}

public function getKeyPrefix()
{
return $this->prefix;
}

public function get($key)
{
return $this->storageadapter->getData($this->prefix . $key);
Expand Down

0 comments on commit e363dd8

Please sign in to comment.