laravel-doctrine / extensions

Extensions integration for Doctrine2 and Laravel

Home Page:http://laraveldoctrine.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Annotation does not exist

EwanValentine opened this issue · comments

I'm migrating my Laravel app over to Doctrine and I'm attempting to use timestamps and I'm getting the following error:

The annotation "@Gedmo\Mapping\Annotation\Timestampable" in property SixtyFiv
  eTwenty\Entities\Collection\Collection::$createdAt does not exist, or could not be auto-loaded.

And my code...

<?php

namespace SixtyFiveTwenty\Entities\Channel;

use Doctrine\ORM\Mapping as ORM;

use LaravelDoctrine\Extensions\Timestamps\Timestamps;

/**
 * Channel
 *
 * @ORM\Entity
 * @ORM\Table(name="channel")
 *
 * @author    Ewan Valentine <ewan@theladbible.com>
 * @copyright TheLADbible Group - 2015
 */
class Channel
{
    use Timestamps;

    /**
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="UUID")
     * @ORM\Column(type="string")
     */
    protected $id;

    /**
     * @ORM\Column(type="string")
     */
    protected $host;

    /**
     * @ORM\Column(type="string")
     */
    protected $name;

    /** 
     * getHost
     *
     * @return string
     */
    public function getHost()
    {
        return $this->host;
    }

    /**
     * setHost
     *
     * @param  string $host
     * @return $this
     */
    public function setHost($host)
    {
        $this->host = $host;

        return $this;
    }

    /**
     * getName
     *
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * setName
     *
     * @param  string $name
     * @return $this
     */
    public function setName($name)
    {
        $this->name = $name;

        return $this;
    }
}

I'm using...

        "laravel-doctrine/orm": "^1.0",
        "laravel-doctrine/extensions": "^1.0"

Hey Ewan,

Did you read the installation instructions (http://www.laraveldoctrine.org/docs/1.0/extensions/installation) and include the Gedmo service provider?

Ahaa! Silly me! Thank you :) Great work on this project also.