Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
synhelper
Commits
a96c1cc0
Commit
a96c1cc0
authored
Dec 08, 2017
by
APolitsin
Browse files
fix presave bug
parent
8f183bac
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/Hook/EntityPresave.php
View file @
a96c1cc0
...
...
@@ -39,7 +39,10 @@ class EntityPresave extends ControllerBase {
$result
=
FALSE
;
if
(
method_exists
(
$entity
,
'bundle'
))
{
if
(
property_exists
(
$entity
,
'name'
))
{
$result
=
$entity
->
bundle
();
$reflector
=
new
\
ReflectionClass
(
get_class
(
$entity
));
if
(
$reflector
->
getProperty
(
'name'
)
->
isPublic
())
{
$result
=
$entity
->
bundle
();
}
}
}
return
$result
;
...
...
@@ -52,7 +55,10 @@ class EntityPresave extends ControllerBase {
$result
=
FALSE
;
if
(
method_exists
(
$entity
,
'getType'
))
{
if
(
property_exists
(
$entity
,
'title'
))
{
$result
=
$entity
->
getType
();
$reflector
=
new
\
ReflectionClass
(
get_class
(
$entity
));
if
(
$reflector
->
getProperty
(
'title'
)
->
isPublic
())
{
$result
=
$entity
->
getType
();
}
}
}
return
$result
;
...
...
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