[ Index ] |
PHP Cross Reference of Phabricator |
[Summary view] [Print] [Text view]
1 <?php 2 3 class Stripe_Util_Set 4 { 5 private $_elts; 6 7 public function __construct($members=array()) 8 { 9 $this->_elts = array(); 10 foreach ($members as $item) 11 $this->_elts[$item] = true; 12 } 13 14 public function includes($elt) 15 { 16 return isset($this->_elts[$elt]); 17 } 18 19 public function add($elt) 20 { 21 $this->_elts[$elt] = true; 22 } 23 24 public function discard($elt) 25 { 26 unset($this->_elts[$elt]); 27 } 28 29 // TODO: make Set support foreach 30 public function toArray() 31 { 32 return array_keys($this->_elts); 33 } 34 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Sun Nov 30 09:20:46 2014 | Cross-referenced by PHPXref 0.7.1 |