private function updateRecordStatus(\record_adapter $record, array $postStatus)
    {
        $sbasId = $record->getDataboxId();

        if (isset($postStatus[$sbasId]) && is_array($postStatus[$sbasId])) {
            $postStatus = $postStatus[$sbasId];
            $currentStatus = strrev($record->getStatus());

            $newStatus = '';
            foreach (range(0, 31) as $i) {
                $newStatus .= isset($postStatus[$i]) ? ($postStatus[$i] ? '1' : '0') : $currentStatus[$i];
            }

            $record->setStatus(strrev($newStatus));

            $this->getDataboxLogger($record->getDatabox())
                ->log($record, \Session_Logger::EVENT_STATUS, '', '');

            return [
                'current_status' => $currentStatus,
                'new_status'     => $newStatus,
            ];
        }

        return null;
    }
private function updateRecordStatus(\record_adapter $record, array $postStatus)
    {
        $sbasId = $record->getDataboxId();

        if (isset($postStatus[$sbasId]) && is_array($postStatus[$sbasId])) {
            $postStatus = $postStatus[$sbasId];
            $currentStatus = strrev($record->getStatus());

            $newStatus = '';
            foreach (range(0, 31) as $i) {
                $newStatus .= isset($postStatus[$i]) ? ($postStatus[$i] ? '1' : '0') : $currentStatus[$i];
            }

            $record->setStatus(strrev($newStatus));

            $this->getDataboxLogger($record->getDatabox())
                ->log($record, \Session_Logger::EVENT_STATUS, '', '');

            return [
                'current_status' => $currentStatus,
                'new_status'     => $newStatus,
            ];
        }

        return null;
    }
private function updateRecordStatus ( \ record_adapter $ record , array $ postStatus ) { $ sbasId = $ record -> getDataboxId ( ) ; if ( isset ( $ postStatus [ $ sbasId ] ) && is_array ( $ postStatus [ $ sbasId ] ) ) { $ postStatus = $ postStatus [ $ sbasId ] ; $ currentStatus = strrev ( $ record -> getStatus ( ) ) ; $ newStatus = '' ; foreach ( range ( 0 , 31 ) as $ i ) { $ newStatus .= isset ( $ postStatus [ $ i ] ) ? ( $ postStatus [ $ i ] ? '1' : '0' ) : $ currentStatus [ $ i ] ; } $ record -> setStatus ( strrev ( $ newStatus ) ) ; $ this -> getDataboxLogger ( $ record -> getDatabox ( ) ) -> log ( $ record , \ Session_Logger :: EVENT_STATUS , '' , '' ) ; return [ 'current_status' => $ currentStatus , 'new_status' => $ newStatus , ] ; } return null ; }
Set new status to selected record

@param  \record_adapter $record
@param  array           $postStatus
@return array|null
Set new status to selected record