Advertisement
puruwin

Untitled

Nov 13th, 2019
538
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.87 KB | None | 0 0
  1. <?php
  2.     class Contacto {
  3.         private $idRegistro;
  4.         private $nombre;
  5.         private $telefono;
  6.  
  7.         public function setId($cod) {
  8.             $this->idRegistro = $cod;
  9.         }
  10.  
  11.         public function getId() {
  12.             return $this->idRegistro;
  13.         }
  14.        
  15.         public function setNombre($str) {
  16.             $this->nombre = $str;
  17.         }
  18.  
  19.         public function getNombre() {
  20.             return $this->nombre;
  21.         }
  22.        
  23.         public function setTelefono($num) {
  24.             $this->telefono = $num;
  25.         }
  26.  
  27.         public function getTelefono() {
  28.             return $this->telefono;
  29.         }
  30.  
  31.         public function __toString() {
  32.             return $this->getId() . "<br/>" .
  33.                     $this->getNombre() . "<br/>" .
  34.                     $this->getTelefono() . "<br/>";
  35.         }
  36.     }
  37. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement