Skip to content

Instantly share code, notes, and snippets.

@arthuralmeidap
Created November 21, 2011 12:46
Show Gist options
  • Select an option

  • Save arthuralmeidap/1382537 to your computer and use it in GitHub Desktop.

Select an option

Save arthuralmeidap/1382537 to your computer and use it in GitHub Desktop.
User model
<?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