本文整理汇总了PHP中record_adapter::getBaseId方法的典型用法代码示例。如果您正苦于以下问题:PHP record_adapter::getBaseId方法的具体用法?PHP record_adapter::getBaseId怎么用?PHP record_adapter::getBaseId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类record_adapter
的用法示例。
在下文中一共展示了record_adapter::getBaseId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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();
}
示例2: editRecordSharing
/**
* Edit a record share state
* @param Request $request
* @param $base_id
* @param $record_id
* @return \Symfony\Component\HttpFoundation\JsonResponse
*/
public function editRecordSharing(Request $request, $base_id, $record_id)
{
$record = new \record_adapter($this->app, \phrasea::sbasFromBas($this->app, $base_id), $record_id);
$subdefName = (string) $request->request->get('name');
$state = $request->request->get('state') == 'true' ? true : false;
$acl = $this->getAclForUser();
if (!$acl->has_right('bas_chupub') || !$acl->has_right_on_base($record->getBaseId(), 'canmodifrecord') || !$acl->has_right_on_base($record->getBaseId(), 'imgtools') || 'document' == $subdefName && !$acl->has_right_on_base($record->getBaseId(), 'candwnldhd') || 'document' != $subdefName && !$acl->has_access_to_subdef($record, $subdefName)) {
$this->app->abort(403);
}
$subdef = $record->get_subdef($subdefName);
if (null === ($permalink = $subdef->get_permalink())) {
return $this->app->json(['success' => false, 'state' => false], 400);
}
try {
$permalink->set_is_activated($state);
$return = ['success' => true, 'state' => $permalink->get_is_activated()];
} catch (\Exception $e) {
$return = ['success' => false, 'state' => $permalink->get_is_activated()];
}
return $this->app->json($return);
}
示例3: listStory
/**
* Retrieve detailed information about one story
*
* @param Request $request
* @param \record_adapter $story
* @return array
* @throws \Exception
*/
public function listStory(Request $request, \record_adapter $story)
{
if (!$story->isStory()) {
return Result::createError($request, 404, 'Story not found')->createResponse();
}
$records = array_map(function (\record_adapter $record) use($request) {
return $this->listRecord($request, $record);
}, array_values($story->get_children()->get_elements()));
$caption = $story->get_caption();
$format = function (\caption_record $caption, $dcField) {
$field = $caption->get_dc_field($dcField);
if (!$field) {
return null;
}
return $field->get_serialized_values();
};
return ['@entity@' => self::OBJECT_TYPE_STORY, 'databox_id' => $story->getDataboxId(), 'story_id' => $story->getRecordId(), 'updated_on' => $story->getUpdated()->format(DATE_ATOM), 'created_on' => $story->getCreated()->format(DATE_ATOM), 'collection_id' => $story->getCollectionId(), 'base_id' => $story->getBaseId(), 'thumbnail' => $this->listEmbeddableMedia($request, $story, $story->get_thumbnail()), 'uuid' => $story->getUuid(), 'metadatas' => ['@entity@' => self::OBJECT_TYPE_STORY_METADATA_BAG, 'dc:contributor' => $format($caption, \databox_Field_DCESAbstract::Contributor), 'dc:coverage' => $format($caption, \databox_Field_DCESAbstract::Coverage), 'dc:creator' => $format($caption, \databox_Field_DCESAbstract::Creator), 'dc:date' => $format($caption, \databox_Field_DCESAbstract::Date), 'dc:description' => $format($caption, \databox_Field_DCESAbstract::Description), 'dc:format' => $format($caption, \databox_Field_DCESAbstract::Format), 'dc:identifier' => $format($caption, \databox_Field_DCESAbstract::Identifier), 'dc:language' => $format($caption, \databox_Field_DCESAbstract::Language), 'dc:publisher' => $format($caption, \databox_Field_DCESAbstract::Publisher), 'dc:relation' => $format($caption, \databox_Field_DCESAbstract::Relation), 'dc:rights' => $format($caption, \databox_Field_DCESAbstract::Rights), 'dc:source' => $format($caption, \databox_Field_DCESAbstract::Source), 'dc:subject' => $format($caption, \databox_Field_DCESAbstract::Subject), 'dc:title' => $format($caption, \databox_Field_DCESAbstract::Title), 'dc:type' => $format($caption, \databox_Field_DCESAbstract::Type)], 'records' => $records];
}