09 2015 档案

摘要:<?phpclass Preferences { private static $instance; private function __construct() { } public static function getInstance() { if (empty... 阅读全文
posted @ 2015-09-04 16:21 wy0314 阅读(93) 评论(0) 推荐(0)
摘要:units, true)) { return ; } $this->units[] = $unit; } public function remove_unit(Unit $unit) { $this->units = ar... 阅读全文
posted @ 2015-09-04 15:50 wy0314 阅读(155) 评论(0) 推荐(0)
摘要:state = $value; } } public function __get($param) { if ($param == 'state') { return $this->state; } } publ... 阅读全文
posted @ 2015-09-02 21:00 wy0314 阅读(123) 评论(0) 推荐(0)
摘要:_adaptee = new Adaptee(); } public function request() { $this->_adaptee->special_request(); }}$target = new Adapter();$target->request... 阅读全文
posted @ 2015-09-02 16:44 wy0314 阅读(114) 评论(0) 推荐(0)
摘要:"; $context->state = new Concrete_state_B(); }}class Concrete_state_B extends State { public function handle(Context $context) { e... 阅读全文
posted @ 2015-09-01 19:23 wy0314 阅读(168) 评论(0) 推荐(0)
摘要:_name = $name; } public function __get($name) { if ($name == '_name') { return $this->_name; } } public function ... 阅读全文
posted @ 2015-09-01 14:46 wy0314 阅读(139) 评论(0) 推荐(0)