Created
November 21, 2011 12:46
-
-
Save arthuralmeidap/1382537 to your computer and use it in GitHub Desktop.
User model
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 | |
| namespace Condominio\SystemBundle\Domain\Entity; | |
| use Doctrine\ORM\Mapping as ORM; | |
| /** | |
| * @ORM\Entity | |
| * @ORM\Table(name="tb_user") | |
| */ | |
| class User | |
| { | |
| /** | |
| * @ORM\Id | |
| * @ORM\GeneratedValue | |
| * @ORM\Column(type="integer", name="id_user") | |
| */ | |
| protected $id; | |
| /** | |
| * @ORM\Column(type="string", name="st_firstname") | |
| */ | |
| protected $firstName; | |
| /** | |
| * @ORM\Column(type="string", name="st_lastname") | |
| */ | |
| protected $lastName; | |
| public function __construct( $firstName, $lastName = '' ) { | |
| if( empty( $firstName ) ){ | |
| throw new InvalidArgumentException( 'Please, inform the user\'s first name ' ); | |
| } | |
| $this->firstName = $firstName; | |
| $this->lastName = $lastName; | |
| } | |
| public function getFullName() { | |
| return $this->firstName .' '. $this->lastName; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment