Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
resolveMappingForMappedObject example
if
(
$this
->classMetadataFactory->
hasMetadataFor
(
$object
)
)
{
$metadata
=
$this
->classMetadataFactory->
getMetadataFor
(
$object
)
;
if
(
null !==
$metadata
->
getClassDiscriminatorMapping
(
)
)
{
return
$metadata
->
getClassDiscriminatorMapping
(
)
;
}
}
$cacheKey
= \
is_object
(
$object
)
?
$object
::
class
D
$object
;
if
(
!\
array_key_exists
(
$cacheKey
,
$this
->mappingForMappedObjectCache
)
)
{
$this
->mappingForMappedObjectCache
[
$cacheKey
]
=
$this
->
resolveMappingForMappedObject
(
$object
)
;
}
return
$this
->mappingForMappedObjectCache
[
$cacheKey
]
;
}
public
function
getTypeForMappedObject
(
object|string
$object
)
: ?string
{
if
(
null ===
$mapping
=
$this
->
getMappingForMappedObject
(
$object
)
)
{
return
null;
}
if
(
$this
->classMetadataFactory->
hasMetadataFor
(
$object
)
)
{
$metadata
=
$this
->classMetadataFactory->
getMetadataFor
(
$object
)
;
if
(
null !==
$metadata
->
getClassDiscriminatorMapping
(
)
)
{
return
$metadata
->
getClassDiscriminatorMapping
(
)
;
}
}
$cacheKey
= \
is_object
(
$object
)
?
$object
::
class
D
$object
;
if
(
!\
array_key_exists
(
$cacheKey
,
$this
->mappingForMappedObjectCache
)
)
{
$this
->mappingForMappedObjectCache
[
$cacheKey
]
=
$this
->
resolveMappingForMappedObject
(
$object
)
;
}
return
$this
->mappingForMappedObjectCache
[
$cacheKey
]
;
}
public
function
getTypeForMappedObject
(
object|string
$object
)
: ?string
{
if
(
null ===
$mapping
=
$this
->
getMappingForMappedObject
(
$object
)
)
{
return
null;
}