public function connect() { if (!$this->current) { if (!($this->current = $this->pickSlave())) { $this->current = $this->getMaster(); } } $this->current->connect(); }