コード例 #1
0
ファイル: DEnum.php プロジェクト: alphadevx/alpha
 /**
  * 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';
     }
 }
コード例 #2
0
ファイル: IntegerTest.php プロジェクト: alphadevx/alpha
 /**
  * Testing the zeroPad method.
  *
  * @since 1.2.1
  */
 public function testZeroPad()
 {
     $val = Integer::zeroPad(25);
     $this->assertEquals('00000000025', $val, 'Testing the zeroPad method');
 }