Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
W
wp-persistence
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Privacy statement
Keyboard shortcuts
?
What's new
3
Snippets
Groups
Projects
Show more breadcrumbs
wpdesk
Library
wp-persistence
Commits
1c1db71b
Commit
1c1db71b
authored
4 years ago
by
Marcin Kolanko
Browse files
Options
Downloads
Patches
Plain Diff
added support for has method
parent
05fbe977
Branches
feature/changed-access-level
Branches containing commit
Tags
Tags containing commit
1 merge request
!3
Feature/changed access level
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Decorator/DelaySinglePersistentContainer.php
+9
-0
9 additions, 0 deletions
src/Decorator/DelaySinglePersistentContainer.php
with
9 additions
and
0 deletions
src/Decorator/DelaySinglePersistentContainer.php
+
9
−
0
View file @
1c1db71b
...
...
@@ -40,6 +40,15 @@ final class DelaySinglePersistentContainer implements DelayPersistentContainer {
throw
new
ElementNotExistsException
(
sprintf
(
'Element %s not exists!'
,
$id
)
);
}
public
function
has
(
$id
)
{
if
(
isset
(
$this
->
changed
[
$id
]
)
&&
$this
->
changed
[
$id
]
)
{
return
isset
(
$this
->
internal_data
[
$id
]
);
}
$data
=
\maybe_unserialize
(
$this
->
container
->
get
(
$this
->
key
)
);
return
is_array
(
$data
)
&&
isset
(
$data
[
$id
]
);
}
public
function
save
()
{
if
(
$this
->
is_changed
()
)
{
$this
->
container
->
set
(
$this
->
key
,
\maybe_serialize
(
$this
->
internal_data
)
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment