在员工节点中我写得像这样
<?php
class employee extends atkNode{
function employee(){
//$this->atkNode("employee");
$this->atkNode("employee" ,NF_ADD_LINK);
$this->setTable("newmod1_employee");
$this->add(new atkNumberAttribute("id",AF_AUTOKEY));
$this->add(new atkAttribute("name" ,AF_OBLIGATORY|AF_SEARCHABLE),NULL,10);
$this->add(new atkListAttribute("designation",array('Manager','Junior Scientist ','PHP Programmer','Sap Programmer','Quality Analyist'),AF_OBLIGATORY),NULL,40);
$this->add(new atkDateAttribute("date",AF_OBLIGATORY),NULL,45);
$this->add(new atkAttribute("location",AF_OBLIGATORY),NULL,50);
$this->add(new atkattribute("branch",AF_OBLIGATORY),NULL,55);
//$this->add(new atkManyToOneRelation("designation","newmod1.employee",AF_SEARCHABLE));
$this->add(new atkNumberAttribute("employeecode",AF_OBLIGATORY),NULL,60);
$this->add(new atkEmailAttribute("email",AF_OBLIGATORY),NULL,65);
}
/*
public function adminFooter(){
return nodeSourceUrl("newmod1.employee");
}*/
}
在部门节点中我写得像这样
class department extends atkNode {
//$descriptor_field="[designation]-[destination]";
function department() {
$this->atkNode("department" ,NF_ADD_LINK);
$this->setTable("newmod1_department");
$this->add(new atkNumberAttribute("id",AF_AUTOKEY), NULL,10);
$this->add(new atkAttribute("name" ,AF_READ_ONLY,AF_OBLIGATORY|AF_SEARCHABLE),NULL,20 );
$this->add(new atkAttribute("branch",AF_OBLIGATORY), NULL,30);
$this->add(new atkListAttribute("designation",array('Manager','Junior Scientist','PHP Programmer','Sap Programmer','Quality Analyist'),AF_PRIMARY|AF_SEARCHABLE|AF_FORCE_LOAD|AF_OBLIGATORY),NULL,40);
//$this->addFilter(new atkOneToManyRelation("designation","newmod1.designation","id", AF_OBLIGATORY), "employees");
$this->add(new atkattribute("Salary",AF_TOTAL ) );
}
/*
public function adminFooter(){
return nodeSourceUrl("newmod1.employee");
}*/
}
我为这两个节点创建了一个表。我不知道如何为部门节点使用过滤器和验证器。
答案 0 :(得分:0)