/** * Used to get the current DEnum item string value. * * @return string * * @since 1.0 */ public function getDisplayValue() { // check to see if the options have already been loaded from the DB if (empty($this->options)) { $this->getOptions(); } $val = Integer::zeroPad($this->value); if (isset($this->options[$val])) { return $this->options[$val]; } else { return 'Unknown'; } }
/** * Testing the zeroPad method. * * @since 1.2.1 */ public function testZeroPad() { $val = Integer::zeroPad(25); $this->assertEquals('00000000025', $val, 'Testing the zeroPad method'); }