Created
July 12, 2015 15:30
-
-
Save pedrochaves/18e753030dbd772072a1 to your computer and use it in GitHub Desktop.
Exemplo de traits
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Person | |
{ | |
protected $name; | |
public function setName($name) | |
{ | |
$this->name = ucwords($name); | |
} | |
public function getName() | |
{ | |
return $this->name; | |
} | |
} | |
class PetOwner extends Person | |
{ | |
} | |
class Veterinarian extends Person | |
{ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment