Я изменил его так, что я удалил кавычки из типа, удалил аргументы и добавил Verified_by_admin, и теперь он работает.
framework:
workflows:
article_publishing:
type: workflow
audit_trail: true
marking_store:
type: multiple_state
supports:
- App\Entity\Article
places:
- draft
- for_review
- approved_by_admin
- published
transitions:
to_for_review:
from: draft
to: for_review
to_approved_by_admin:
from: for_review
to: approved_by_admin
to_published:
from: approved_by_admin
to: published
to_draft:
from: for_review
to: draft
И я добавляю в контроллер этот код
/**
* @Route("/apply-transition/{article}", methods={"POST"})
*/
public function applyTransition(WorkflowInterface $articleWorkflow, Request $request, Article $article, RouterInterface $router)
{
$slug = $article->getCategory()->getSlug();
try {
$articleWorkflow->apply($article, $request->request->get('transition'));
$this->repository->flush();
} catch (ExceptionInterface $e) {
echo $e->getMessage();
}
$url = $router->generate('app_category_view', ([
'slug' => $slug,
]));
return new RedirectResponse($url);
}
/**
* @Route("/resetMarking/{article}", methods={"POST"})
*/
public function resetMarking(Article $article, RouterInterface $router)
{
$slug = $article->getCategory()->getSlug();
$article->setMarking([]);
$this->repository->flush();
$url = $router->generate('app_category_view', ([
'slug' => $slug,
]));
return new RedirectResponse($url);
}
И к Entity я добавляю это
/**
* @ORM\Column(type="json_array", nullable=true)
*/
private $marking;
/**
* @ORM\Column(type="json_array", nullable=true)
*/
private $transitionContexts;