本文整理匯總了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;
}