$data['iconCls'
] = 'sprite-cross';
} $this->
View()->
assign(['success' => true, 'data' =>
$data]);
} catch (ORMException
$e) { $this->
View()->
assign(['success' => false, 'errorMsg' =>
$e->
getMessage()]);
} } public function deletePaymentAction() { if (!
$this->
Request()->
isPost()) { $this->
View()->
assign(['success' => false, 'errorMsg' => 'Empty Post Request'
]);
return;
} $repository =
$this->
get('models'
)->
getRepository(Payment::
class);
$id =
$this->
Request()->
get('id'
);
$model =
$repository->
find($id);
if ($model->
getSource() == 1
) { try { $this->
get('models'
)->
remove($model);
$this->
get('models'
)->
flush();