当前位置: 首页>>代码示例>>PHP>>正文


PHP record_adapter::get_record_by_sha方法代码示例

本文整理汇总了PHP中record_adapter::get_record_by_sha方法的典型用法代码示例。如果您正苦于以下问题:PHP record_adapter::get_record_by_sha方法的具体用法?PHP record_adapter::get_record_by_sha怎么用?PHP record_adapter::get_record_by_sha使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在record_adapter的用法示例。


在下文中一共展示了record_adapter::get_record_by_sha方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testGet_record_by_sha

 public function testGet_record_by_sha()
 {
     $record_1 = $this->getRecord1();
     $tmp_records = record_adapter::get_record_by_sha($record_1->getDatabox(), $record_1->get_sha256());
     $this->assertTrue(is_array($tmp_records));
     foreach ($tmp_records as $tmp_record) {
         $this->assertInstanceOf('record_adapter', $tmp_record);
         $this->assertEquals($record_1->get_sha256(), $tmp_record->get_sha256());
     }
     $tmp_records = record_adapter::get_record_by_sha($record_1->getDatabox(), $record_1->get_sha256(), $record_1->get_record_id());
     $this->assertTrue(is_array($tmp_records));
     $this->assertTrue(count($tmp_records) === 1);
     foreach ($tmp_records as $tmp_record) {
         $this->assertInstanceOf('record_adapter', $tmp_record);
         $this->assertEquals($record_1->get_sha256(), $tmp_record->get_sha256());
         $this->assertEquals($record_1->get_record_id(), $tmp_record->get_record_id());
     }
 }
开发者ID:luisbrito,项目名称:Phraseanet,代码行数:18,代码来源:adapterTest.php

示例2: check

 /**
  * {@inheritdoc}
  */
 public function check(EntityManager $em, File $file)
 {
     $boolean = !count(\record_adapter::get_record_by_sha($this->app, $file->getCollection()->get_databox()->get_sbas_id(), $file->getSha256()));
     return new Response($boolean, $this);
 }
开发者ID:nlegoff,项目名称:Phraseanet,代码行数:8,代码来源:Sha256.php

示例3: testGet_record_by_sha

 public function testGet_record_by_sha()
 {
     $tmp_records = record_adapter::get_record_by_sha(self::$DI['app'], self::$DI['record_1']->get_sbas_id(), self::$DI['record_1']->get_sha256());
     $this->assertTrue(is_array($tmp_records));
     foreach ($tmp_records as $tmp_record) {
         $this->assertInstanceOf('record_adapter', $tmp_record);
         $this->assertEquals(self::$DI['record_1']->get_sha256(), $tmp_record->get_sha256());
     }
     $tmp_records = record_adapter::get_record_by_sha(self::$DI['app'], self::$DI['record_1']->get_sbas_id(), self::$DI['record_1']->get_sha256(), self::$DI['record_1']->get_record_id());
     $this->assertTrue(is_array($tmp_records));
     $this->assertTrue(count($tmp_records) === 1);
     foreach ($tmp_records as $tmp_record) {
         $this->assertInstanceOf('record_adapter', $tmp_record);
         $this->assertEquals(self::$DI['record_1']->get_sha256(), $tmp_record->get_sha256());
         $this->assertEquals(self::$DI['record_1']->get_record_id(), $tmp_record->get_record_id());
     }
 }
开发者ID:romainneutron,项目名称:Phraseanet,代码行数:17,代码来源:adapterTest.php

示例4: getRecordsToSubstitute

 /**
  * Get an array of records that can be substitued by the Lazaret file
  *
  * @return array
  */
 public function getRecordsToSubstitute(Application $app)
 {
     $ret = [];
     $shaRecords = \record_adapter::get_record_by_sha($app, $this->getCollection($app)->get_sbas_id(), $this->getSha256());
     $uuidRecords = \record_adapter::get_record_by_uuid($app, $this->getCollection($app)->get_databox(), $this->getUuid());
     $merged = array_merge($uuidRecords, $shaRecords);
     foreach ($merged as $record) {
         if (!in_array($record, $ret)) {
             $ret[] = $record;
         }
     }
     return $ret;
 }
开发者ID:nlegoff,项目名称:Phraseanet,代码行数:18,代码来源:LazaretFile.php


注:本文中的record_adapter::get_record_by_sha方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。