I can’t launch my simple Fixture, I installed the bundle in the right way and put the 2 lines in autoload.php and Appkernel.php like stated at here, and then I created my fixture class as it follows:
<?php
namespace ABCBundle\DataFixtures\ORM;
use Doctrine\Common\DataFixtures\FixtureInterface;
use ABCBundle\Entity\Rubrica;
class LoadRubricaData implements FixtureInterface
{
public function load(ObjectManager $manager)
{
$rubrica = new Rubrica();
$rubrica->setX("XXX");
$manager->persist($rubrica);
$manager->flush();
}
}
?>
But when I try to launch it from the CLI with
php app/console doctrine:fixtures:load
I get:
Fatal error: Declaration of ABCBundle\DataFixtures\ORM\LoadRubricaData::load() must be compatible with that of Doctrine\Common\DataFixtures\FixtureInterface::load() in […]ABCBundle/DataFixtures/ORM/LoadRubricaData.php on line 10
but if you go to take a look at that interface you can see it’s correct:
interface FixtureInterface
{
/**
* Load data fixtures with the passed EntityManager
*
* @param Doctrine\Common\Persistence\ObjectManager $manager
*/
function load(ObjectManager $manager);
}
What’s wrong?
Damnit, I forgot to add the line