Created
April 25, 2020 16:50
-
-
Save siljanoskam/059f0f747bc60fa493f243346d73d386 to your computer and use it in GitHub Desktop.
Repository interface
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
<?php | |
namespace App\Repositories; | |
class Repository implements RepositoryInterface | |
{ | |
protected $items = []; | |
protected $error = false; | |
public function getItems() | |
{ | |
return $this->items; | |
} | |
public function setItems($items): Repository | |
{ | |
$this->items = $items; | |
return $this; | |
} | |
public function setError(Bool $error): Repository | |
{ | |
$this->error = $error; | |
return $this; | |
} | |
public function hasError(): Bool | |
{ | |
return $this->error; | |
} | |
} |
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
<?php | |
namespace App\Repositories; | |
interface RepositoryInterface | |
{ | |
public function getItems(); | |
public function setItems($items); | |
public function setError(Bool $error); | |
public function hasError(): Bool; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment