SHARE
TWEET

Untitled

a guest Apr 25th, 2019 90 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. function debug($string)
  4. {
  5.     $separator = (php_sapi_name() == 'cli') ? "\n" : "<br>";
  6.     echo $string . $separator;
  7. }
  8.  
  9. Class Channel
  10. {
  11.     public static $channel;
  12.  
  13.     public static function create($channel)
  14.     {
  15.         self::$channel[] = $channel;
  16.         return new static;
  17.     }
  18.  
  19.     public static function getListByName()
  20.     {
  21.         sort(self::$channel);
  22.         return new static;
  23.     }
  24.  
  25.     public function getName()
  26.     {
  27.  
  28.     }
  29. }
  30.  
  31. $gaul = Channel::create('Channel Gaul');
  32. $lebay = Channel::create('Channel Lebay');
  33. $alay = Channel::create('Channel Alay');
  34.  
  35. foreach (Channel::getListByName() as $availableChannel) {
  36.     debug($availableChannel->getName());
  37. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top