/** * remove type of robot from factory list. * * @param BaseRobot $object * @return bool */ public function removeType(BaseRobot $object) { $key = $object->getTypeName(); $types = $this->getTypes(); if (array_key_exists($key, $types)) { unset($this->{$types}[$key]); $this->setTypes($types); echo "\nRemoved {$key} from factory type list."; return true; } return false; }
public function _write($contents, $data = array()) { $data = array_merge($this->data, (array) $data); $message = array('server' => $this->server, 'message' => $contents, 'data' => $data); parent::_write(json_encode($message)); }