Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
preparePaymentData example
public
function
create
(
array
$params
)
{
$this
->
checkPrivilege
(
'create'
)
;
$payment
=
new
PaymentModel
(
)
;
$payment
->
setAdditionalDescription
(
''
)
;
$params
=
$this
->
preparePaymentData
(
$params
)
;
$payment
->
fromArray
(
$params
)
;
$violations
=
$this
->
getManager
(
)
->
validate
(
$payment
)
;
if
(
$violations
->
count
(
)
> 0
)
{
throw
new
ApiException\
ValidationException
(
$violations
)
;
}
$this
->
getManager
(
)
->
persist
(
$payment
)
;
$this
->
flush
(
)
;