Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Banco
- {
- private $dsn;
- private $usuario;
- private $senha;
- public function setDsn($d)
- {
- $this->dsn = $d;
- }
- public function getDsn()
- {
- return $this->dsn;
- }
- public function serUsuario($u)
- {
- $this->user = $u;
- }
- public function getUsuario()
- {
- return $this->usuario;
- }
- public function setSenha($s)
- {
- $this->senha = $s;
- }
- public function getSenha()
- {
- return $this->senha;
- }
- public function novaConexao()
- {
- $user = $this->getUsuario();
- $pass = $this->getSenha();
- return new Pdo($this->getDsn(), $user, $pass);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement