Validation PSR2

This commit is contained in:
jcherqui
2014-11-05 10:24:19 +01:00
parent 37cdbd6c23
commit d5b96d139f
7 changed files with 103 additions and 40 deletions

View File

@@ -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());
}
}
}