i made a new bundle,
made a new controller
made few entities
entity does get in the database when i use php console dotrine:schema:update –force
i make a form,
form pops great,
when i submit i use
if ($form->isValid()) {
// perform some action, such as saving the task to the database
$em = $this->getDoctrine()->getEntityManager();
$em->persist($type);
$em->flush();
return $this->redirect($this->generateUrl('_success'));
}
i get a big fat error :
Class Naus\Biobalance\Entity\Sample is not a valid entity or mapped
super class.
i’ve double checked my top..
and use Naus\bundle\Entity\Sample; is mentioned like it is supposed to be ?
no clear answers online, hope someone can help..
the first lines of the entity (on request)
<?php
namespace Naus\Biobalance\Entity;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="sample")
*/
class Sample
{
regarding the appkernel :
<?php
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
new Symfony\Bundle\TwigBundle\TwigBundle(),
new Symfony\Bundle\MonologBundle\MonologBundle(),
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
new Symfony\Bundle\DoctrineBundle\DoctrineBundle(),
new Symfony\Bundle\DoctrineFixturesBundle\DoctrineFixturesBundle(),
new Symfony\Bundle\AsseticBundle\AsseticBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(),
new Knplabs\Bundle\MenuBundle\KnplabsMenuBundle(),
new Knplabs\Bundle\SnappyBundle\KnplabsSnappyBundle(),
new Knp\Bundle\PaginatorBundle\KnpPaginatorBundle(),
new AntiMattr\GoogleBundle\GoogleBundle(),
new Fp\OpenIdBundle\FpOpenIdBundle(),
new Naus\Api\NausApi(),
new Naus\App\NausApp(),
new Naus\Cms\NausCms(),
new Naus\Crm\NausCrm(),
new Naus\Event\NausEvent(),
new Naus\Form\NausForm(),
new Naus\Invoicing\NausInvoicing(),
new Naus\Mail\NausMail(),
new Naus\Media\NausMedia(),
new Naus\Member\NausMember(),
new Naus\Meta\NausMeta(),
new Naus\Project\NausProject(),
new Naus\Vacancy\NausVacancy(),
new Naus\Workgroup\NausWorkgroup(),
new Naus\Biobalance\NausBiobalance(),
Apparently, setting the auto_mapping setting found in config.yml solves the problem.