Here is the problem : I don't succeed to install doctrine extensions with symphony 2, especially timestampable. I follow this tutorial
How I proceed :
I add this lines in deps file :
[gedmo-doctrine-extensions]
git=http://github.com/l3pp4rd/DoctrineExtensions.git
[Stof-DoctrineExtensionsBundle]
git=https://github.com/stof/StofDoctrineExtensionsBundle.git
target=/bundles/Stof/DoctrineExtensionsBundle
Then I enter the line
./bin/vendors install --reinstall
All is fine.
Then I activate extensions in concerned files
# config.yml
stof_doctrine_extensions:
default_locale: fr_FR
orm:
default:
timestampable: true
# AppKernel.php
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
[...]
new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
[...]
);
# autoload.php
use Symfony\Component\ClassLoader\UniversalClassLoader;
use Doctrine\Common\Annotations\AnnotationRegistry;
$loader = new UniversalClassLoader();
$loader->registerNamespaces(array(
'Gedmo' => __DIR__.'/../vendor/gedmo-doctrine-extensions/lib',
'Stof' => __DIR__.'/../vendor/bundles',
[...]
));
At last, I add annotate my entity
/**
* @var datetime $updatedAt
*
* @ORM\Column(name="updated_at", type="datetime")
* @Gedmo:Timestampable(on="update")
*/
private $updatedAt;
But I have this error :
Fatal error: Class 'Gedmo\Timestampable\TimestampableListener' not found in /Symfony/app/cache/dev/appDevDebugProjectContainer.php on line 203
What do I do wrong ?
Using @Gedmo\Timestampable(on="update")
and putting the right path when registering the namespace seems to solve the problem.