validateStream example

$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);

        if ($index) {
            $this->indexStream($stream);
        }

        if (\array_key_exists('customers', $data) && $stream->isStatic()) {
            $this->insertCustomers($data['customers']$stream->getId());
        }

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