[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/applications/herald/config/ -> HeraldRepetitionPolicyConfig.php (source)

   1  <?php
   2  
   3  final class HeraldRepetitionPolicyConfig {
   4  
   5    const FIRST   = 'first';  // only execute the first time (no repeating)
   6    const EVERY   = 'every';  // repeat every time
   7  
   8    private static $policyIntMap = array(
   9      self::FIRST   => 0,
  10      self::EVERY   => 1,
  11    );
  12  
  13    public static function getMap() {
  14      return array(
  15        self::EVERY   => pht('every time'),
  16        self::FIRST   => pht('only the first time'),
  17      );
  18    }
  19  
  20    public static function toInt($str) {
  21      return idx(self::$policyIntMap, $str, self::$policyIntMap[self::EVERY]);
  22    }
  23  
  24    public static function toString($int) {
  25      return idx(array_flip(self::$policyIntMap), $int, self::EVERY);
  26    }
  27  
  28  }


Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1