Я получаю эту ошибку, когда сохраняю свою сущность
Другой «Класс 'X' не был найден в цепочке сконфигурированных пространств имен.
Раньше это работало до того, как я перенес свой Symfony с Windows на Linux.
мой контроллер:
public function SubscriptionHandlingAction(Request $request)
{
if ($request->isMethod('POST'))
{
$form = $this->createForm(new NewCustomer(), new Customer());
$form->bind($request);
if ($form->isValid())
{
// get the form data
$newcustomer = $form->getData();
//get the date and set it in the entity
$datecreation = new \DateTime(date('d-m-Y'));
$newcustomer->setdatecreation($datecreation);
//this works fine
echo $newcustomer->getname();
//persist the data
$em = $this->getDoctrine()->getManager();
$em->persist($newcustomer);
$em->flush();
return $this->render('NRtworksSubscriptionBundle:Subscription:subscription_success.html.twig');
}
Конечно, сущность моего класса существует, так как я могу создавать на ее основе форму, объекты и т.д. Однако эта сущность не "сопоставляется", что означает, что doctrine:mapping:info ничего мне не дает (но я создал вручную соответствующие sdl и поместите все аннотации):
<?php
namespace NRtworks\SubscriptionBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity
* @ORM\Table(name="Customer")
*/
class Customer
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $idCustomer;
/**
* @ORM\Column(type="string", length=100, unique = true)
*/
protected $name;
/**
* @ORM\Column(type="string", length=50)
*/
protected $country;
/**
* @ORM\Column(type="datetime", nullable = false)
*/
protected $datecreation;
/**
* @ORM\Column(type="integer", length = 5, nullable = false)
*/
protected $admin_user;
//getter
// no need for that
// setter
// no need for that
}
?>
Любые намеки на проблему?
Большое спасибо