dongyou7292 2013-04-16 10:05
浏览 25

在Doctrine 2中设置列别名时出错

I am using Doctrine 2.3.3 as ORM in my project. Everything is running smooth and fine. Now i want to give my column names my own aliases. I've read in the documentation of doctrine 2 that the following code is the way to give aliases.

<?php
/**
 * @Entity(repositoryClass="Entity\Repositories\EmployeeRepository")
 * @Entity @Table(name="tbl_employee")
 */
class TblEmployee
{
    /** @Id @Column(name="employee_id",type="string",length=45) */
    public $emid;

    //getters

    public function getEmId()
    {
        return $this->emid;
    }

    //setters

    public function setEmployeeId($emid)
    {
        $this->emid = $emid;
    }

?>

but when i execute this code I get the error

[Semantical Error] line 0, col 36 near 'employee_id <': Error: Class TblEmployee has no field or association named employee_id

how do i solve this?? or what is the correct way to give aliases to the columns??

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 求解达问题(有红包)
    • ¥15 请解包一个pak文件
    • ¥15 不同系统编译兼容问题
    • ¥100 三相直流充电模块对数字电源芯片在物理上它必须具备哪些功能和性能?
    • ¥30 数字电源对DSP芯片的具体要求
    • ¥20 antv g6 折线边如何变为钝角
    • ¥30 如何在Matlab或Python中 设置饼图的高度
    • ¥15 nginx中的CORS策略应该如何配置
    • ¥30 信号与系统实验:采样定理分析
    • ¥100 我想找人帮我写Python 的股票分析代码,有意请加mathtao