Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
CustomerStreamEntity example
public
function
create
(
array
$data
,
$index
= false
)
{
$this
->
checkPrivilege
(
'save'
)
;
$data
=
$this
->
prepareData
(
$data
)
;
$stream
=
new
CustomerStreamEntity
(
)
;
$stream
->
fromArray
(
$data
)
;
$violations
=
$this
->
getManager
(
)
->
validate
(
$stream
)
;
if
(
$violations
->
count
(
)
> 0
)
{
throw
new
ValidationException
(
$violations
)
;
}
$this
->
validateStream
(
$stream
)
;
$this
->
getManager
(
)
->
persist
(
$stream
)
;
$this
->
getManager
(
)
->
flush
(
$stream
)
;