Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
C
cache_register-3183611
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Issue forks
cache_register-3183611
Commits
16a7d23b
Commit
16a7d23b
authored
Nov 18, 2020
by
mrweiner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add getCacheData() method instead of option
parent
70b13427
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
8 deletions
+23
-8
src/Slot.php
src/Slot.php
+8
-2
src/SlotInterface.php
src/SlotInterface.php
+15
-6
No files found.
src/Slot.php
View file @
16a7d23b
...
...
@@ -102,16 +102,22 @@ class Slot implements SlotInterface {
return
TRUE
;
}
/**
* {@inheritDoc}
*/
public
function
getCache
()
{
return
$this
->
cache
->
get
(
$this
->
id
);
}
/**
* {@inheritDoc}
*/
public
function
getCache
(
$data_only
=
FALSE
)
{
public
function
getCache
Data
(
)
{
if
(
!
$cache_item
=
$this
->
cache
->
get
(
$this
->
id
))
{
return
FALSE
;
}
return
$
data_only
?
$cache_item
->
data
:
$cache_item
;
return
$
cache_item
->
data
;
}
/**
...
...
src/SlotInterface.php
View file @
16a7d23b
...
...
@@ -52,16 +52,25 @@ interface SlotInterface {
public
function
addCacheTags
(
$tags
);
/**
* Gets the slots cache entry.
*
* @param bool $data_only
* If true, returns the data cache entry's data
* instead of the entry itself.
* Gets the slot's cache entry.
*
* @return object|false
* The cache item or FALSE on failure.
*/
public
function
getCache
(
$data_only
=
FALSE
);
public
function
getCache
();
/**
* Gets the data from the slot's cache entry.
*
* Do not use this method if the data itself is
* a boolean, as there is no way to tell whether
* FALSE was returned because the cache is not set
* or because the value of the data is FALSE.
*
* @return mixed
* The cache item's data or FALSE on failure.
*/
public
function
getCacheData
();
/**
* Delete the slot's cache entry.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment