私は新しいバンドルを作り、新しいコントローラーを作り、いくつかのエンティティを作りました
php console dotrine:schema:update --forceを使用すると、エンティティはデータベースに取り込まれます
私はフォームを作成します、フォームは素晴らしいポップです、私が提出するとき私は使用します
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'));
}
大きなファットエラーが発生します:
クラスNaus\Biobalance \ Entity \ Sampleは、有効なエンティティまたはマップされたスーパークラスではありません。
トップを再確認しました。Naus\bundle\ Entity\Sampleを使用します。それが想定されているように言及されていますか?オンラインで明確な答えはありません。誰かが助けてくれることを願っています。
エンティティの最初の行(要求に応じて)
<?php
namespace Naus\Biobalance\Entity;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="sample")
*/
class Sample
{
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(),