2
我有這個錯誤,當我嘗試承諾推我的工作..我在註釋註釋中寫入參數...在codfe我寫多個函數內容參數和資源,也選項和所有類型這個參數是數組而且內容類型參數詮釋
代碼處理:
<?php
namespace AppBundle\Handler;
use AppBundle\Entity\University;
use AppBundle\Form\UniversityType;
use Symfony\Component\HttpFoundation\RequestStack;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\Form\formFactory;
/**
* UniversityHandler.
*/
class UniversityHandler implements HandlerInterface
{
/**
*function construct.
*
* @param EntityManagerInterface $entityManager
* @param formFactory $formFactory
* @param RequestStack $requestStack
*/
public function __construct(EntityManagerInterface $entityManager, formFactory $formFactory, RequestStack $requestStack)
{
$this->em = $entityManager;
$this->formFactory = $formFactory;
$this->requestStack = $requestStack;
}
/**
*function get.
*
* @param int $id
*/
public function get($id)
{
throw new \DomainException('Method UniversitaireHandler::get not implemented');
}
/**
*function all.
*
* @param int $limit
* @param int $offset
*/
public function all($limit = 10, $offset = 0)
{
throw new \DomainException('Method UniversitaireHandler::all not implemented');
}
/**
*function post.
*
* @param array $parameters
* @param array $options
*
* @return \Symfony\Component\Form\Form The form
*/
public function post(array $parameters, array $options = [])
{
$request = $this->requestStack->getCurrentRequest();
$form = $this->formFactory->create(UniversityType::class, new University(), array('csrf_protection' => 'false'));
$form->handleRequest($request);
if ($form->isValid() && $form->isSubmitted()) {
$universitaire = $form->getData();
$this->persistAndFlush($universitaire);
return $universitaire;
}
return $form;
}
/**
*function put.
*
* @param array $parameters
* @param array $options
* @param array $resource
*/
public function put($resource, array $parameters, array $options)
{
throw new \DomainException('Method UniversitaireHandler::put not implemented');
}
/**
*function patch.
*
* @param array $parameters
* @param array $options
* @param array $resource
*/
public function patch($resource, array $parameters, array $options)
{
throw new \DomainException('Method UniversitaireHandler::patch not implemented');
}
/**
*function delete.
*
* @param array $resource
*/
public function delete($resource)
{
throw new \DomainException('Method UniversitaireHandler::delete not implemented');
}
/**
*function persisteAndFlush.
*/
protected function persistAndFlush($object)
{
$this->em->persist($object);
$this->em->flush();
}
}
如何解決這個錯誤,請...