예제 #1
0
파일: AProfile.php 프로젝트: eggbe/soauth
 /**
  * @return array
  */
 public final function toArray()
 {
     $Data = [];
     foreach (array_keys($this->Values) as $name) {
         $Data[$name] = call_user_func_array([$this, 'get' . Src::tocm($name, '-', '_')], []);
     }
     return $Data;
 }
예제 #2
0
 /**
  * @return string
  */
 public function getKey()
 {
     return is_null($this->key) ? Src::frcm(preg_replace('/^.*\\\\/', null, get_class($this))) : $this->key;
 }
예제 #3
0
 /**
  * @param string $name
  * @param array $Args
  * @return Client|string
  * @throws \Exception
  */
 public function __call($name, array $Args = [])
 {
     if (is_null($this->namespace)) {
         $this->namespace = Src::frcm($name, '-');
         return $this;
     }
     try {
         $Bridge = (new Bridge($this->url, Bridge::RM_POST))->withToken($this->token)->withMethod($name)->withNamespace($this->namespace)->withParams($Args);
         if (count($this->Watchers) > 0) {
             foreach ($this->Watchers as $Watcher) {
                 $Bridge->with($Watcher->getKey(), $Watcher->watch());
             }
         }
         return !is_null($this->Wrapper) ? $this->Wrapper->call($this, $Bridge->send()) : $Bridge->send();
     } finally {
         $this->namespace = null;
     }
 }