I am writing an annotation parser for php (I cannot used any 3rd party ones due to specific needs) and I took sympfony2 code as an inspiration
namespace Acme\StoreBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="product")
*/
class Product
{
/**
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
As I can see here we define ORM in use statement and then somehow the annotation parser knows that ORM is an alias to Doctrine\ORM\Mapping.
My ultimate goal is to be able to pass class names as aliases into my annotations
use some/namespace/Enum;
use another/ns/PropEnum;
class Abc
{
/**
* @Enum(PropEnum)
**/
protected $prop;
}
Could you please point me towards the right direction as I do not even know where to start?
Thanks