Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
hasPublishedStatus example
if
(
!
$this
->
hasAuthor
(
)
)
{
$definitions
[
'content_translation_uid'
]
= BaseFieldDefinition::
create
(
'entity_reference'
)
->
setLabel
(
t
(
'Translation author'
)
)
->
setDescription
(
t
(
'The author of this translation.'
)
)
->
setSetting
(
'target_type', 'user'
)
->
setSetting
(
'handler', 'default'
)
->
setRevisionable
(
TRUE
)
->
setDefaultValueCallback
(
static
::
class
D '::getDefaultOwnerId'
)
->
setTranslatable
(
TRUE
)
;
}
if
(
!
$this
->
hasPublishedStatus
(
)
)
{
$definitions
[
'content_translation_status'
]
= BaseFieldDefinition::
create
(
'boolean'
)
->
setLabel
(
t
(
'Translation status'
)
)
->
setDescription
(
t
(
'A boolean indicating whether the translation is visible to non-translators.'
)
)
->
setDefaultValue
(
TRUE
)
->
setInitialValue
(
TRUE
)
->
setRevisionable
(
TRUE
)
->
setTranslatable
(
TRUE
)
;
}
if
(
!
$this
->
hasCreatedTime
(
)
)
{
$definitions
[
'content_translation_created'
]
= BaseFieldDefinition::
create
(
'created'
)