本文整理汇总了PHP中record_adapter::set_binary_status方法的典型用法代码示例。如果您正苦于以下问题:PHP record_adapter::set_binary_status方法的具体用法?PHP record_adapter::set_binary_status怎么用?PHP record_adapter::set_binary_status使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类record_adapter
的用法示例。
在下文中一共展示了record_adapter::set_binary_status方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updateRecordStatus
/**
* Set new status to selected record
*
* @param \record_adapter $record
* @param array $postStatus
* @return array|null
*/
private function updateRecordStatus(\record_adapter $record, array $postStatus)
{
$sbasId = $record->get_databox()->get_sbas_id();
if (isset($postStatus[$sbasId]) && is_array($postStatus[$sbasId])) {
$postStatus = $postStatus[$sbasId];
$currentStatus = strrev($record->get_status());
$newStatus = '';
foreach (range(0, 31) as $i) {
$newStatus .= isset($postStatus[$i]) ? $postStatus[$i] ? '1' : '0' : $currentStatus[$i];
}
$record->set_binary_status(strrev($newStatus));
return ['current_status' => $currentStatus, 'new_status' => $newStatus];
}
return null;
}
示例2: testSetStatus
public function testSetStatus()
{
$record = new \record_adapter(self::$DI['app'], self::$DI['record_1']->get_sbas_id(), self::$DI['record_1']->get_record_id());
$record->set_binary_status('1001001001010101');
$this->assertSame('00000000000000001001001001010101', $record->get_status());
}
示例3: testSetStatus
public function testSetStatus()
{
$record_1 = $this->getRecord1();
$record = new \record_adapter($this->getApplication(), $record_1->get_sbas_id(), $record_1->get_record_id());
$record->set_binary_status('1001001001010101');
$this->assertSame('00000000000000001001001001010101', $record->get_status());
}
示例4: updateRecord
/**
* {@inheritdoc}
*/
public function updateRecord(\record_adapter $record)
{
$record->set_binary_status(\databox_status::dec2bin($this->app, bindec($record->get_status()) & ~7 | 4));
return $this;
}