我想学习如何为我的项目使用和创建自定义注释。我不想使用框架。但是,我愿意为此使用库。
任何准则?怎么做的例子?
例如,假设我要创建自定义ORM:
/*
*@Table(name="TableName")
*/
class TableName{
/*
*@Column(type="int")
*/
protected $id;
public static createtabe(){/*creates table with properties defined in the annotation*/}
}