Ojs\ApiBundle\Handler\PostHandler::processForm PHP Метод

processForm() приватный Метод

Processes the form.
private processForm ( AdminPost $entity, array $parameters, String $method = "PUT" ) : AdminPost
$entity Ojs\AdminBundle\Entity\AdminPost
$parameters array
$method String
Результат Ojs\AdminBundle\Entity\AdminPost
    private function processForm(AdminPost $entity, array $parameters, $method = "PUT")
    {
        $form = $this->formFactory->create(new AdminPostType(), $entity, array('method' => $method, 'csrf_protection' => false));
        $form->submit($parameters, 'PATCH' !== $method);
        if ($form->isValid()) {
            $page = $form->getData();
            $entity->setCurrentLocale('en');
            $entity->setSlug($entity->getTitle());
            $this->om->persist($entity);
            $this->om->flush();
            return $page;
        }
        throw new InvalidFormException('Invalid submitted data', $form);
    }