function getGateway() { if ($this->gateway1 === null) { $conn = new TDbConnection('mysql:host=localhost;dbname=prado_unitest', 'prado_unitest', 'prado_unitest'); $this->gateway1 = new TTableGateway('address', $conn); } return $this->gateway1; }