prepareOrderData example

if (empty($id)) {
            throw new ParameterMissingException('id');
        }

        $order = $this->getRepository()->find($id);

        if (!$order) {
            throw new NotFoundException(sprintf('Order by id %d not found', $id));
        }

        $params = $this->prepareOrderData($params$order);

        $order->fromArray($params);

        $violations = $this->getManager()->validate($order);
        if ($violations->count() > 0) {
            throw new ValidationException($violations);
        }

        $this->flush();

        return $order;
    }
Home | Imprint | This part of the site doesn't use cookies.