\TbPercentOfTypeOperation

## TbPercentOfTypeOperation class

Renders a summary based on the percent count of specified types. For example, if a value has a type 'blue', this class will count the percentage number of times the value 'blue' has on that column.

Summary

Methods
Properties
Constants
init()
processValue()
displaySummary()
run()
$template
$typeTemplate
$types
$value
$label
$column
No constants found
getTotal()
$_total
N/A
No private methods found
No private properties found
N/A

Properties

$template

$template : string

Type

string — the template to display label and value of the operation at the summary

$typeTemplate

$typeTemplate : string

Type

string

$types

$types : array

Type

array — hold the configuration of types to calculate. The configuration is set by an array which keys are the value types to count. You can set their 'label' independently. <pre> 'types' => array( '0' => array('label' => 'zeros'), '1' => array('label' => 'ones'), '2' => array('label' => 'twos') </pre>

$value

$value : int

Type

int — the resulted value of operation

$label

$label : string

Type

string — the label of the calculated value

$_total

$_total : integer

Type

integer — holds the total sum of the values. Required to get the percentage.

Methods

init()

init()

Widget initialization

Throws

\CException

processValue()

processValue(mixed $value) : mixed

Process the row data value

Parameters

mixed $value

Returns

mixed

displaySummary()

displaySummary() : mixed|void

(no phpDoc)

Returns

mixed|void

run()

run()

Widget's run method

getTotal()

getTotal() : int

Returns the total of types

Returns

int —

holds