コード例 #1
0
ファイル: WarpManager.php プロジェクト: TBNRFrags2468/Economy
 /**
  * (PHP 5 &gt;= 5.0.0)<br/>
  * Offset to set
  * @link http://php.net/manual/en/arrayaccess.offsetset.php
  * @param mixed $offset <p>
  * The offset to assign the value to.
  * </p>
  * @param mixed $value <p>
  * The value to set.
  * </p>
  * @return void
  */
 public function offsetSet($offset, $value)
 {
     if ($value instanceof Warp && $value->getName() === $offset) {
         if ($this->flag < 2) {
             $this->warps[$offset] = $value;
         }
         if ($this->flag >= 1) {
             $this->store->add($offset, $this->warpToData($value));
             $this->saveStore();
         }
     } else {
         //TODO report failure
     }
 }
コード例 #2
0
 protected function registerDefault($name, $text)
 {
     if (!$this->store->exists($name)) {
         $this->store->add($name, $text);
     }
 }