FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
DesignPatternsPHP/More/Repository/Storage.php at flyweight · JavaDevl/DesignPatternsPHP · GitHub
JavaDevl
/
DesignPatternsPHP
Public
forked from
DesignPatternsPHP/DesignPatternsPHP
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
DesignPatternsPHP
/
More
/
Repository
/
Storage.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
42 lines (38 loc) · 906 Bytes
Breadcrumbs
DesignPatternsPHP
/
More
/
Repository
/
Storage.php
Copy path
File metadata and controls
42 lines (38 loc) · 906 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?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
);
}
Back
|
FazBrowse Home
|
New Git URL