public function updateStateTransitionMatrix(array $matrix)
    {
        // Do some cleanup, we don't need to store too many things
        foreach ($matrix as $from => $toList) {
            foreach ($toList as $to => $roleList) {
                $current = array_filter($roleList);
                if ($from == $to || empty($current)) {
                    unset($matrix[$from][$to]);
                } else {
                    // Store the role list as key-value for easier usage
                    $matrix[$from][$to] = array_combine($current, $current);
                }
            }
        }
        variable_set('ucms_site_state_transition_matrix', $matrix);
    }
public function updateStateTransitionMatrix(array $matrix)
    {
        // Do some cleanup, we don't need to store too many things
        foreach ($matrix as $from => $toList) {
            foreach ($toList as $to => $roleList) {
                $current = array_filter($roleList);
                if ($from == $to || empty($current)) {
                    unset($matrix[$from][$to]);
                } else {
                    // Store the role list as key-value for easier usage
                    $matrix[$from][$to] = array_combine($current, $current);
                }
            }
        }
        variable_set('ucms_site_state_transition_matrix', $matrix);
    }
public function updateStateTransitionMatrix ( array $ matrix ) { // Do some cleanup, we don't need to store too many things foreach ( $ matrix as $ from => $ toList ) { foreach ( $ toList as $ to => $ roleList ) { $ current = array_filter ( $ roleList ) ; if ( $ from == $ to || empty ( $ current ) ) { unset ( $ matrix [ $ from ] [ $ to ] ) ; } else { // Store the role list as key-value for easier usage $ matrix [ $ from ] [ $ to ] = array_combine ( $ current , $ current ) ; } } } variable_set ( 'ucms_site_state_transition_matrix' , $ matrix ) ; }
Update state transition matrix

@param int[int[int[]]] $matrix
The full matrix as described in the ::getStateTransitionMatrix()
method
Update state transition matrix