/** * This is what Datamanager calls to actually create a query */ function &dm2_create_callback(&$controller) { $query = new org_openpsa_reports_query_dba(); $query->component = $this->_component; if (!$query->create()) { debug_print_r('We operated on this object:', $query); throw new midcom_error("Failed to create a new project. Error: " . midcom_connection::get_error_string()); } $this->_request_data['query'] = $query; return $query; }
public function testCRUD() { midcom::get('auth')->request_sudo('org.openpsa.reports'); $query = new org_openpsa_reports_query_dba(); $stat = $query->create(); $this->assertTrue($stat); $this->register_object($query); $query = new org_openpsa_reports_query_dba($query->guid); $this->assertEquals('.html', $query->extension); $this->assertEquals(ORG_OPENPSA_OBTYPE_REPORT_TEMPORARY, $query->orgOpenpsaObtype); $this->assertEquals('text/html', $query->mimetype); $this->assertEquals('unnamed', $query->title); $query->title = 'TEST'; $stat = $query->update(); $this->assertTrue($stat); $query->refresh(); $this->assertEquals('TEST', $query->title); $stat = $query->delete(); $this->assertTrue($stat); midcom::get('auth')->drop_sudo(); }