本文整理汇总了PHP中Audit::persistManualAuditArray方法的典型用法代码示例。如果您正苦于以下问题:PHP Audit::persistManualAuditArray方法的具体用法?PHP Audit::persistManualAuditArray怎么用?PHP Audit::persistManualAuditArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Audit
的用法示例。
在下文中一共展示了Audit::persistManualAuditArray方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _createAudit
protected function _createAudit($providerId, $personId, $visitId, $type)
{
$providerId = (int) $providerId;
$personId = (int) $personId;
$visitId = (int) $visitId;
$audit = array();
$audit['objectClass'] = 'GenericAccessAudit';
$audit['objectId'] = $personId . ';' . $visitId;
$audit['type'] = (int) $type;
$audit['userId'] = $providerId;
$audit['patientId'] = $personId;
$values = array();
$provider = new Provider();
$provider->personId = $audit['userId'];
$provider->populate();
$values['provider'] = $provider->toArray();
$patient = new Patient();
$patient->personId = $personId;
$patient->populate();
$values['patient'] = $patient->toArray();
$values['personId'] = $patient->personId;
$visit = new Visit();
$visit->visitId = $visitId;
$visit->populate();
$values['visit'] = $visit->toArray();
$values['visitId'] = $visit->visitId;
$audit['auditValues'] = $values;
Audit::persistManualAuditArray($audit);
}
示例2: persist
public function persist()
{
$db = Zend_Registry::get('dbAdapter');
if ($this->_persistMode == WebVista_Model_ORM::DELETE) {
return parent::persist();
}
$data = $this->toArray();
if (!strlen($data['uuid']) > 0) {
$this->uuid = NSDR::create_guid();
$data['uuid'] = $this->uuid;
$db->insert($this->_table, $data);
} else {
$db->update($this->_table, $data, 'uuid = ' . $db->quote($data['uuid']));
}
if ($this->shouldAudit()) {
$audit = array();
$audit['objectClass'] = get_class($this);
$audit['objectId'] = $data['uuid'];
$audit['auditValues'] = $data;
Audit::persistManualAuditArray($audit);
}
return $this;
}
示例3: _dispatch
//.........这里部分代码省略.........
$dataContents = $tmpData;
}
$recipients = array();
$addresses = explode(',', $headers['to']);
$db = Zend_Registry::get('dbAdapter');
foreach ($addresses as $address) {
if (preg_match('/<(.*)>/', $address, $matches)) {
$address = $matches[1];
}
$x = explode('@', $address);
$username = $x[0];
$domain = $x[1];
$sqlSelect = $db->select()->from('patient', 'person_id')->where('record_number = ?', $username);
$personId = 0;
if ($row = $db->fetchRow($sqlSelect)) {
$personId = $row['person_id'];
}
$recipients[] = array('personId' => $personId, 'address' => $address, 'username' => $username, 'domain' => $domain);
}
file_put_contents('/tmp/smtp.log', "\ndata contents: " . print_r($dataContents, true), FILE_APPEND);
foreach ($dataContents as $content) {
$contentTypes = $content['contentTypes'];
$filename = null;
// email has an attachments
if (isset($contentTypes['content-disposition']) && (isset($contentTypes['content-transfer-encoding']) && strtolower($contentTypes['content-transfer-encoding']) == 'base64')) {
// temporarily accept base64 encoding that serves as an attachment
$contentType = $contentTypes['content-type'];
// image/jpeg; name="sample-signature.jpeg"
$types = explode(';', $contentType);
$mimeType = array_shift($types);
foreach ($types as $type) {
$type = ltrim($type);
if (preg_match('/^name="(.*)"/', $type, $matches)) {
$filename = '/tmp/' . $matches[1];
break;
}
}
if ($filename === null) {
// try to create a random filename with specific extension based on mime type
$extension = MimeType::extension($mimeType);
$tmpFile = tempnam('/tmp', 'ch30_attach_');
$filename = $tmpFile . '.' . $extension;
//rename($tmpFile,$filename);
unlink($tmpFile);
}
$content['content'] = base64_decode($content['content']);
// decode the base64 encoded file
}
foreach ($recipients as $recipient) {
$personId = $recipient['personId'];
$messagingId = WebVista_Model_ORM::nextSequenceId();
$messaging = array();
$messaging['note'] = 'Email message: ' . $content['content'];
$attachmentId = 0;
if ($filename !== null) {
$attachmentId = WebVista_Model_ORM::nextSequenceId();
$attachment = array();
$attachment['attachmentId'] = $attachmentId;
$attachment['attachmentReferenceId'] = md5($headers['messageId']);
$attachment['name'] = basename($filename);
$attachment['dateTime'] = date('Y-m-d H:i:s', strtotime($headers['date']));
$attachment['mimeType'] = $mimeType;
$attachment['md5sum'] = md5($content['content']);
$db->insert('attachments', $attachment);
$audit = array();
$audit['objectClass'] = 'Attachment';
$audit['objectId'] = $attachment['attachmentId'];
$audit['auditValues'] = $attachment;
Audit::persistManualAuditArray($audit);
$attachmentBlob = array();
$attachmentBlob['attachmentId'] = $attachment['attachmentId'];
$attachmentBlob['data'] = $content['content'];
$db->insert('attachmentBlobs', $attachmentBlob);
$messaging['note'] = 'Scanned document for ' . $recipient['address'];
}
$messaging['messagingId'] = $messagingId;
$messaging['objectType'] = Messaging::TYPE_INBOUND_FAX;
$messaging['status'] = 'Fax/Email Received';
$messaging['dateStatus'] = date('Y-m-d H:i:s');
$db->insert('messaging', $messaging);
$messagingInboundFax = array();
$messagingInboundFax['messagingId'] = $messaging['messagingId'];
$messagingInboundFax['personId'] = $personId;
$messagingInboundFax['mrn'] = $recipient['username'];
$messagingInboundFax['subject'] = $headers['subject'];
$messagingInboundFax['from'] = $headers['from'];
$messagingInboundFax['to'] = $recipient['address'];
$messagingInboundFax['messageId'] = $headers['messageId'];
$messagingInboundFax['attachmentId'] = $attachmentId;
$db->insert('messagingInboundFaxes', $messagingInboundFax);
$audit = array();
$audit['objectClass'] = 'MessagingInboundFax';
$audit['objectId'] = $messagingInboundFax['messagingId'];
$audit['auditValues'] = $messagingInboundFax;
Audit::persistManualAuditArray($audit);
}
}
unlink($this->messageFilename);
return $this;
}