public function setAdapter(adapter $adapter = null) { $this->adapter = $adapter ?: new adapter(); return $this; }