public function testRecordAddAttribute() { $r = new Response(); $re = new Record(); $re->set("foo", "bar"); $r->append($re); $expected = '<Response><Record foo="bar"></Record></Response>'; $this->assertXmlStringEqualsXmlString($expected, $r->asUrl(False)); }
public function addSignInput($post) { if (isset($post['comment'])) { $this->record->set('comment', $post['comment']); $this->record->saveToDB(); } if (isset($post['presignpt'])) { if ($post['presignpt'] && $this->user->canPreSign()) { $this->record->preSignRecord(); } } if (isset($post['unpresignpt'])) { if ($post['unpresignpt'] && $this->user->canUnPreSign()) { $this->record->unPreSignRecord(); } } if (isset($post['signpt'])) { if ($post['signpt'] && $this->user->canSign()) { $this->record->signRecord(); $this->record->preSignRecord(); } } if (isset($post['unsignpt'])) { if ($post['unsignpt'] && $this->user->canUnsign()) { $this->record->unsignRecord(); } } }
function insertData($values) { $source = new Record($this->dbcon); $source->setSource($this->datatable); $source->set($values); $sql = $source->debug_insertSQL(); if ($this->dbcon->Execute($sql)) { AMP::debug_sql($sql, get_class($this) . ' insert'); return $this->dbcon->Affected_Rows(); } trigger_error(sprintf(AMP_TEXT_ERROR_DATABASE_SQL_FAILED, get_class($this), 'insert', $this->dbcon->ErrorMsg(), $sql)); return false; }
function set($field) { return parent::set($field); }