mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-06 15:06:31 +02:00
Validation PSR2
This commit is contained in:
@@ -5,8 +5,12 @@ namespace DesignPatterns\Repository;
|
||||
/**
|
||||
* Repository for class Post
|
||||
* This class is between Entity layer(class Post) and access object layer(interface Storage)
|
||||
* 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
|
||||
* Repository also supports the objective of achieving a clean separation and one-way dependency between the domain and data mapping layers
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* Repository also supports the objective of achieving a clean separation and one-way dependency
|
||||
* between the domain and data mapping layers
|
||||
*
|
||||
* Class PostRepository
|
||||
* @package DesignPatterns\Repository
|
||||
@@ -29,7 +33,7 @@ class PostRepository
|
||||
public function getById($id)
|
||||
{
|
||||
$arrayData = $this->persistence->retrieve($id);
|
||||
if(is_null($arrayData)){
|
||||
if (is_null($arrayData)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -72,4 +76,4 @@ class PostRepository
|
||||
{
|
||||
return $this->persistence->delete($post->getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user