Advertisement
Guest User

Untitled

a guest
Apr 25th, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.70 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement