Retrieve records by Enum type
Each collector can call the method getEnum that allows you to retrieve labels compared to the values of the enum to a column in a database.
function getEnum($var) { }
Settings
- $var : corresponds to the column that is of type enum in the database
Example
The following example allows you to retrieve the labels relative to the enum values for the column "ex_type" the collector "example"
$rows = $this->collector['example']->getEnum('ex_type');<br />
In the class of the collector, first create the property this way :
protected $ex_type = array('EX1' => 'Example 1', 'EX2' => 'Example 2');
The function's return
This method returns an array containing the enum values
<span>Array
(
["EX1"] =<span class="entity"><span>></span></span> "Example 1"
["EX2"] =<span class="entity"><span>></span></span> "Example 2"
)</span><br />