本文整理汇总了PHP中record_adapter::get_thumbnail方法的典型用法代码示例。如果您正苦于以下问题:PHP record_adapter::get_thumbnail方法的具体用法?PHP record_adapter::get_thumbnail怎么用?PHP record_adapter::get_thumbnail使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类record_adapter
的用法示例。
在下文中一共展示了record_adapter::get_thumbnail方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildTabUserWhat
/**
* Return basic information about a record
*
* @param integer $bid base id
* @param integer $rid record id
* @param array $tab config for the html table
*
* @return array
*/
public function buildTabUserWhat($bid, $rid, $tab = false)
{
$this->initialize();
$sbas_id = phrasea::sbasFromBas($this->app, $bid);
try {
$record = new record_adapter($this->app, $sbas_id, $rid);
} catch (\Exception_Record_AdapterNotFound $e) {
return $this->report;
}
$this->setDisplay($tab);
$this->champ = ['photo', 'record_id', 'date', 'type', 'titre', 'taille'];
$document = $record->get_subdef('document');
$this->title = $this->app->trans('report:: Information sur l\'enregistrement numero %number%', ['%number%' => (int) $rid]);
$x = $record->get_thumbnail();
$this->result[] = ['photo' => "<img style='width:" . $x->get_width() . "px;height:" . $x->get_height() . "px;'\n src='" . $x->get_url() . "'>", 'record_id' => $record->get_record_id(), 'date' => $this->app['date-formatter']->getPrettyString($document->get_creation_date()), 'type' => $document->get_mime(), 'titre' => $record->get_title(), 'taille' => $document->get_size()];
$this->setDisplayNav();
$this->setReport();
return $this->report;
}
示例2: testUploadWithoutB64Image
/**
* @covers Alchemy\Phrasea\Controller\Prod\Upload::upload
* @covers Alchemy\Phrasea\Controller\Prod\Upload::getJsonResponse
*/
public function testUploadWithoutB64Image()
{
self::$DI['app']['notification.deliverer'] = $this->getMockBuilder('Alchemy\\Phrasea\\Notification\\Deliverer')->disableOriginalConstructor()->getMock();
$params = ['base_id' => self::$DI['collection']->get_base_id()];
$files = ['files' => [new UploadedFile($this->tmpFile, 'KIKOO.JPG')]];
/** @var Client $client */
$client = self::$DI['client'];
$client->request('POST', '/prod/upload/', $params, $files, ['HTTP_Accept' => 'application/json']);
$response = $client->getResponse();
$this->checkJsonResponse($response);
$datas = json_decode($response->getContent(), true);
$this->assertTrue($datas['success']);
if ($datas['element'] == 'record') {
$id = explode('_', $datas['id']);
$record = new \record_adapter(self::$DI['app'], $id[0], $id[1]);
$this->assertFalse($record->get_thumbnail()->is_physically_present());
}
}
示例3: list_story
/**
* Retrieve detailled informations about one story
*
* @param record_adapter $story
*
* @return array
*/
public function list_story(record_adapter $story)
{
if (!$story->is_grouping()) {
throw new \API_V1_exception_notfound('Story not found');
}
$that = $this;
$records = array_map(function (\record_adapter $record) use($that) {
return $that->list_record($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->get_sbas_id(), 'story_id' => $story->get_record_id(), 'updated_on' => $story->get_modification_date()->format(DATE_ATOM), 'created_on' => $story->get_creation_date()->format(DATE_ATOM), 'collection_id' => phrasea::collFromBas($this->app, $story->get_base_id()), 'thumbnail' => $this->list_embedable_media($story->get_thumbnail()), 'uuid' => $story->get_uuid(), '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];
}