cli) { die("not cli"); } } function get() { $this->init(); DB_DataObject::DebugLevel(1); $oc = $this->loadOwnerCompany(); $p = DB_DataObject::factory('Person'); if ($p->get('email', 'test@roojs.com')) { $p->delete(); } $p = DB_DataObject::factory('Person'); $p->setFrom(array( 'email' => 'test@roojs.com', 'name' => 'test', 'company_id' => $oc->id, )); $p->setPassword("test123"); $p->insert(); $p->onInsert(array(),$this); print_R($p);exit; //onUpdate($old, $request,$roo) } }