Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
simple_sitemap
Commits
d274265d
Commit
d274265d
authored
Jul 11, 2016
by
Pawel G
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
getBundleSettings() and bundleIsIndexed() do not require bundle parameter anymore
parent
a17500c5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
src/Simplesitemap.php
src/Simplesitemap.php
+4
-3
No files found.
src/Simplesitemap.php
View file @
d274265d
...
...
@@ -123,7 +123,7 @@ class Simplesitemap {
* Example: ['index' => TRUE, 'priority' => 0.5]
*/
public
function
setBundleSettings
(
$entity_type_id
,
$bundle_name
=
NULL
,
$settings
)
{
$bundle_name
=
!
empty
(
$bundle_name
)
?
$
bundle_name
:
$entity_type_id
;
$bundle_name
=
is_null
(
$bundle_name
)
?
$
entity_type_id
:
$bundle_name
;
$entity_types
=
$this
->
getConfig
(
'entity_types'
);
$this
->
addLinkSettings
(
'entity'
,
$settings
,
$entity_types
[
$entity_type_id
][
$bundle_name
]);
$this
->
saveConfig
(
'entity_types'
,
$entity_types
);
...
...
@@ -165,7 +165,8 @@ class Simplesitemap {
return
FALSE
;
}
public
function
getBundleSettings
(
$entity_type_id
,
$bundle_name
)
{
public
function
getBundleSettings
(
$entity_type_id
,
$bundle_name
=
NULL
)
{
$bundle_name
=
is_null
(
$bundle_name
)
?
$entity_type_id
:
$bundle_name
;
$entity_types
=
$this
->
getConfig
(
'entity_types'
);
if
(
isset
(
$entity_types
[
$entity_type_id
][
$bundle_name
]))
{
$settings
=
$entity_types
[
$entity_type_id
][
$bundle_name
];
...
...
@@ -175,7 +176,7 @@ class Simplesitemap {
return
FALSE
;
}
public
function
bundleIsIndexed
(
$entity_type_id
,
$bundle_name
)
{
public
function
bundleIsIndexed
(
$entity_type_id
,
$bundle_name
=
NULL
)
{
$settings
=
$this
->
getBundleSettings
(
$entity_type_id
,
$bundle_name
);
return
!
empty
(
$settings
[
'index'
]);
}
...
...
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