本文整理汇总了PHP中record_adapter::getUuid方法的典型用法代码示例。如果您正苦于以下问题:PHP record_adapter::getUuid方法的具体用法?PHP record_adapter::getUuid怎么用?PHP record_adapter::getUuid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类record_adapter
的用法示例。
在下文中一共展示了record_adapter::getUuid方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: serialize
public function serialize(\record_adapter $record)
{
$caption = $business = $status = [];
$technicalInformation = $record->get_technical_infos()->getValues();
foreach ($record->get_caption()->get_fields(null, true) as $field) {
$isDate = $field->get_databox_field()->get_type() === \databox_field::TYPE_DATE;
$isBusiness = $field->get_databox_field()->isBusiness();
$vi = $field->get_values();
if ($field->is_multi()) {
$values = [];
foreach ($vi as $value) {
$values[] = $this->sanitizeSerializedValue($value->getValue());
}
$value = implode(' ' . $field->get_databox_field()->get_separator(false) . ' ', $values);
} else {
$value = $this->sanitizeSerializedValue(array_pop($vi)->getValue());
}
if ($isDate) {
try {
$date = new \DateTime($value);
$value = $date->format(DATE_ATOM);
} catch (\Exception $e) {
continue;
}
}
if ($isBusiness) {
$business[$field->get_databox_field()->get_name()] = $value;
}
$caption[$field->get_databox_field()->get_name()] = $value;
}
$i = 0;
foreach (preg_split('//', strrev($record->get_status()), -1, PREG_SPLIT_NO_EMPTY) as $val) {
$status['status-' . $i] = (int) $val;
$i++;
}
return ['databox_id' => $record->get_sbas_id(), 'record_id' => $record->get_record_id(), 'collection_id' => $record->get_collection()->get_coll_id(), 'base_id' => $record->get_base_id(), 'mime_type' => $record->get_mime(), 'title' => $record->get_title(), 'original_name' => $record->get_original_name(), 'updated_on' => $record->get_modification_date()->format(DATE_ATOM), 'created_on' => $record->get_creation_date()->format(DATE_ATOM), 'sha256' => $record->get_sha256(), 'technical_informations' => $technicalInformation, 'phrasea_type' => $record->get_type(), 'type' => $record->isStory() ? 'story' : 'record', 'uuid' => $record->getUuid(), 'caption' => $caption, 'status' => $status, 'caption-business' => $business];
}
示例2: mirror
/**
* @param record_adapter $record
*/
private function mirror(record_adapter $record)
{
$this->mime = $record->getMimeType();
$this->sha256 = $record->getSha256();
$this->original_name = $record->getOriginalName();
$this->type = $record->getType();
$this->isStory = $record->isStory();
$this->uuid = $record->getUuid();
$this->updated = $record->getUpdated();
$this->created = $record->getCreated();
$this->base_id = $record->getBaseId();
$this->collection_id = $record->getCollectionId();
}