prepareShopData example

/** * @throws Exception * @throws ValidationException * * @return ShopModel */
    public function create(array $params)
    {
        $this->checkPrivilege('create');

        $params = $this->prepareShopData($params);

        $shop = new ShopModel();
        $shop->fromArray($params);

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

        $this->getManager()->persist($shop);
        $this->flush();

        
Home | Imprint | This part of the site doesn't use cookies.