You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: More/Repository/PostRepository.php
+8-4Lines changed: 8 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -5,8 +5,12 @@
5
5
/**
6
6
* Repository for class Post
7
7
* This class is between Entity layer(class Post) and access object layer(interface Storage)
8
-
* Repository encapsulates the set of objects persisted in a data store and the operations performed over them, providing a more object-oriented view of the persistence layer
9
-
* Repository also supports the objective of achieving a clean separation and one-way dependency between the domain and data mapping layers
8
+
*
9
+
* Repository encapsulates the set of objects persisted in a data store and the operations performed over them
10
+
* providing a more object-oriented view of the persistence layer
11
+
*
12
+
* Repository also supports the objective of achieving a clean separation and one-way dependency
13
+
* between the domain and data mapping layers
10
14
*
11
15
* Class PostRepository
12
16
* @package DesignPatterns\Repository
@@ -29,7 +33,7 @@ public function __construct(Storage $persistence)
29
33
publicfunctiongetById($id)
30
34
{
31
35
$arrayData =$this->persistence->retrieve($id);
32
-
if(is_null($arrayData)){
36
+
if(is_null($arrayData)){
33
37
returnnull;
34
38
}
35
39
@@ -72,4 +76,4 @@ public function delete(Post $post)