PHP7 More

This commit is contained in:
Dominik Liebler
2016-09-22 18:32:37 +02:00
parent 461d612b91
commit 6ac29916c3
6 changed files with 84 additions and 191 deletions

View File

@@ -1,42 +0,0 @@
<?php
namespace DesignPatterns\More\Repository;
/**
* Interface Storage.
*
* This interface describes methods for accessing storage.
* Concrete realization could be whatever we want - in memory, relational database, NoSQL database and etc
*/
interface Storage
{
/**
* Method to persist data
* Returns new id for just persisted data.
*
* @param array() $data
*
* @return int
*/
public function persist($data);
/**
* Returns data by specified id.
* If there is no such data null is returned.
*
* @param int $id
*
* @return array|null
*/
public function retrieve($id);
/**
* Delete data specified by id
* If there is no such data - false returns, if data has been successfully deleted - true returns.
*
* @param int $id
*
* @return bool
*/
public function delete($id);
}