Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getAutoFlush example
/** * @param ModelEntity $entity * * @throws OrmException * * @return void */
public
function
flush
(
$entity
= null
)
{
if
(
$this
->
getAutoFlush
(
)
)
{
$this
->
getManager
(
)
->
getConnection
(
)
->
beginTransaction
(
)
;
try
{
$this
->
getManager
(
)
->
flush
(
$entity
)
;
$this
->
getManager
(
)
->
getConnection
(
)
->
commit
(
)
;
$this
->
getManager
(
)
->
clear
(
)
;
}
catch
(
Exception
$e
)
{
$this
->
getManager
(
)
->
getConnection
(
)
->
rollBack
(
)
;
throw
new
OrmException
(
$e
->
getMessage
(
)
,
$e
)
;
}
}
}