Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 6
CRAP
0.00% covered (danger)
0.00%
0 / 22
CargoOutlineRow
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 6
56
0.00% covered (danger)
0.00%
0 / 22
 __construct
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 3
 addOutlineFieldValues
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 5
 addOutlineFieldValue
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 5
 addDisplayFieldValue
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 2
 getOutlineFieldValues
0.00% covered (danger)
0.00%
0 / 1
6
0.00% covered (danger)
0.00%
0 / 5
 getFormattedOutlineFieldValues
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 2
<?php
/**
 * Represents a single row in the outline.
 */
class CargoOutlineRow {
    public $mOutlineFields;
    public $mDisplayFields;
    public function __construct() {
        $this->mOutlineFields = [];
        $this->mDisplayFields = [];
    }
    public function addOutlineFieldValues( $fieldName, $values, $formattedValues ) {
        $this->mOutlineFields[$fieldName] = [
            'unformatted' => $values,
            'formatted' => $formattedValues
        ];
    }
    public function addOutlineFieldValue( $fieldName, $value, $formattedValue ) {
        $this->mOutlineFields[$fieldName] = [
            'unformatted' => [ $value ],
            'formatted' => [ $formattedValue ]
        ];
    }
    public function addDisplayFieldValue( $fieldName, $value ) {
        $this->mDisplayFields[$fieldName] = $value;
    }
    public function getOutlineFieldValues( $fieldName ) {
        if ( !array_key_exists( $fieldName, $this->mOutlineFields ) ) {
            throw new MWException( wfMessage( "cargo-query-specifiedfieldmissing", $fieldName, "outline fields" )->parse() );
        }
        return $this->mOutlineFields[$fieldName]['unformatted'];
    }
    public function getFormattedOutlineFieldValues( $fieldName ) {
        return $this->mOutlineFields[$fieldName]['formatted'];
    }
}