0
Doctrine은 기본 기본 키로 "id"를 설정합니다. 어떻게 수정할 수 있습니까? 테이블에 두 개의 열만 있습니다. "type_code"및 "type_name"이 있으며 "type_code"는 prmary 키입니다.Doctrine에서 기본 키 이름을 수정하는 방법
Doctrine은 기본 기본 키로 "id"를 설정합니다. 어떻게 수정할 수 있습니까? 테이블에 두 개의 열만 있습니다. "type_code"및 "type_name"이 있으며 "type_code"는 prmary 키입니다.Doctrine에서 기본 키 이름을 수정하는 방법
여기에 샘플 테이블 정의 당신을 도울 것입니다 :)
class typetable extends Doctrine_Record
{
public function setTableDefinition()
{
$this->setTableName('your table name ');
$this->hasColumn('type_code', 'integer', 8, array('type' => 'integer',
'length' => 8, 'primary' => true, 'autoincrement' => true));
$this->hasColumn('type_name', 'string', 255, array('type' =>
'string', 'length' => 255));
}
///// extra code here ......
}
덕분에, 나는 기본 키는 방법 "setTableDefinition"로 설정해야한다, 또는 교리는 기본적은 "ID"를 설정합니다 것으로 나타났습니다. – user514340