XOOPS  2.6.0
NullProvider.php
Go to the documentation of this file.
1 <?php
2 /*
3  You may not change or alter any portion of this comment or credits
4  of supporting developers from this source code or any supporting source code
5  which is considered copyrighted (c) material of the original comment or credit authors.
6 
7  This program is distributed in the hope that it will be useful,
8  but WITHOUT ANY WARRANTY; without even the implied warranty of
9  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 */
11 
12 namespace Xoops\Core\Service;
13 
17 
39 class NullProvider extends Provider
40 {
42  private $response = null;
43 
51  {
52  $this->response = new Response();
53  $this->response->setSuccess(false)->addErrorMessage(sprintf("No provider installed for %s", $service));
54  parent::__construct($manager, $service);
55  }
56 
62  public function isAvailable()
63  {
64  return false;
65  }
66 
75  public function __set($name, $value)
76  {
77  }
78 
86  public function __get($name)
87  {
88  return null;
89  }
90 
98  public function __isset($name)
99  {
100  return false;
101  }
102 
110  public function __unset($name)
111  {
112  }
113 
122  public function __call($name, $arguments)
123  {
124  return $this->response;
125  }
126 
135  public static function __callStatic($name, $arguments)
136  {
137  $response = new Response();
138  $response->setSuccess(false)->addErrorMessage(sprintf("No provider installed for %s", get_called_class()));
139  return $response;
140  }
141 }
static __callStatic($name, $arguments)
__construct(Manager $manager, $service)