protected function sendSignedRequest($type, RecordInterface $record = null) { $url = new Url($this->getEndpoint()); $body = $record !== null ? Json::encode($record->getFields()) : null; $header = array('Content-Type' => 'application/json', 'Accept' => 'application/json'); return $this->signedRequest($type, $url, $header, $body); }
/** * Inserts an record for approval * * @param integer $type * @param PSX_Data_RecordInterface $record * @return void */ public function approveRecord($type, RecordInterface $record) { $type = Record::getType($type); if ($type !== false) { $date = new DateTime('NOW', $this->registry['core.default_timezone']); $this->sql->insert($this->registry['table.core_approval_record'], array('userId' => $this->user->id, 'type' => $type, 'table' => $this->table->getName(), 'record' => serialize($record->getFields()), 'date' => $date->format(DateTime::SQL))); } else { throw new Exception('Invalid approve record type'); } }