IRefillPhone.php 730 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace refill;
  3. use mtopcard;
  4. use Log;
  5. abstract class IRefillPhone extends IRefill
  6. {
  7. public function __construct($cfgs)
  8. {
  9. parent::__construct($cfgs);
  10. foreach ($cfgs['card_type'] as $ctype)
  11. {
  12. $ctype = strtolower($ctype);
  13. if ($ctype == "chinamobile") {
  14. $this->mCardType[] = mtopcard\ChinaMobileCard;
  15. } elseif ($ctype == "chinaunicom") {
  16. $this->mCardType[] = mtopcard\ChinaUnicomCard;
  17. } elseif($ctype == "chinatelecom") {
  18. $this->mCardType[] = mtopcard\ChinaTelecomCard;
  19. } else {
  20. Log::record("Phone Provider has no name", Log::ERR);
  21. }
  22. }
  23. }
  24. }