BaseException
Child element not found
Additional information:
- Raised by object: Object Model_Tools(enjouanissonoffice_tools_model_tools)
- element: Notes
Possible Actions:
:
Stack trace:
/Volumes/Data/Work/Black Pig/Enjouanisson/Office/atk4/lib/BaseException.php :38 BaseException BaseException->collectBasicData(Null, Null, Null) /Volumes/Data/Work/Black Pig/Enjouanisson/Office/atk4/lib/AbstractObject.php :300 BaseException BaseException->__construct("Child element not found", Null, Null, Null) / : enjouanissonoffice_tools_model_tools Model_Tools->exception("Child element not found") /Volumes/Data/Work/Black Pig/Enjouanisson/Office/atk4/lib/Model/Table.php :94 Loggercall_user_func_array(Array(2), Array(1)) /Volumes/Data/Work/Black Pig/Enjouanisson/Office/atk4/lib/AbstractObject.php :210 enjouanissonoffice_tools_model_tools Model_Tools->exception("Child element not found") /Volumes/Data/Work/Black Pig/Enjouanisson/Office/atk4/lib/Model/Table.php :229 enjouanissonoffice_tools_model_tools Model_Tools->getElement("Notes") /Volumes/Data/Work/Black Pig/Enjouanisson/Office/page/tools.php :9 enjouanissonoffice_tools_model_tools Model_Tools->ref("Notes") /Volumes/Data/Work/Black Pig/Enjouanisson/Office/atk4/lib/AbstractObject.php :197 enjouanissonoffice_tools page_tools->init() /Volumes/Data/Work/Black Pig/Enjouanisson/Office/atk4/lib/ApiFrontend.php :122 enjouanissonoffice Frontend->add("page_tools", "tools", "Content") /Volumes/Data/Work/Black Pig/Enjouanisson/Office/atk4/lib/ApiWeb.php :399 enjouanissonoffice Frontend->layout_Content() /Volumes/Data/Work/Black Pig/Enjouanisson/Office/atk4/lib/ApiFrontend.php :37 enjouanissonoffice Frontend->addLayout("Content") /Volumes/Data/Work/Black Pig/Enjouanisson/Office/atk4/lib/ApiWeb.php :271 enjouanissonoffice Frontend->initLayout() /Volumes/Data/Work/Black Pig/Enjouanisson/Office/index.php :15 enjouanissonoffice Frontend->main()
class Controller_Notes extends AbstractController { function init(){ parent::init();
$j=$this->owner->join("objects"); $j->addField("note_count");
$this->owner->hasMany("Notes","id","object_id"); //Model,model_id,our_id
$this->owner->addMethod("refNotes",$this); }}class page_tools extends Page { function init(){ parent::init();
$fields['grid'] = array('name', 'type', 'purchase_dt','current_hrs'); $fields['edit'] = array('type', 'name', 'purchase_dt','purchase_hrs','current_hrs','purchase_price','purchase_from','disposal_dt');
$m = $this->add('Model_Tools')->ref('Notes');
$crud = $this->add('CRUD'); $crud->setModel($m,$fields['edit'],$fields['grid']); $crud->grid->addColumn('Expander','Notes');
}}
class Model_Tools extends Model_Table{ public $table="tools";
function init(){ parent::init();
$err = "This is a reqired field";
$this->addField('name')->mandatory($err); $this->addField('type')->listData(array('t'=>'Tractor','e'=>'Equipment')); $this->addField('purchase_dt')->type('date'); $this->addField('purchase_hrs')->type('number'); $this->addField('current_hrs')->type('number'); $this->addField('purchase_price')->type('number'); $this->addField('purchased_from_id'); $this->addField('disposal_dt')->type('date');
$this->hasOne('Object','object_id')->type('system');
}}
class Model_Notes extends Model_Table{ public $table="notes";
function init(){ parent::init();
$err = "This is a reqired field";
$this->addField('name')->mandatory($err); $this->addField('type')->listData(array('t'=>'Tractor','e'=>'Equipment')); $this->addField('date')->type('date')->defaultValue(date('Y-m-d')); $this->addField('blurb')->type('text');
$this->setOrder('date','desc'); }}
$this->add('Controller_Notes'); // put it in Model_Tools init() method