Skip to content

Instantly share code, notes, and snippets.

@baldurrensch
Created September 7, 2012 20:38
Show Gist options
  • Save baldurrensch/3669417 to your computer and use it in GitHub Desktop.
Save baldurrensch/3669417 to your computer and use it in GitHub Desktop.
Simple field example
<?php
// Of course you also need your Doctrine Annotations
class Example
{
protected $firstName;
protected $lastName;
protected $username;
public function setFirstName($firstName)
{
$this->username = $firstName . "." . $this->lastName;
$this->firstName = $firstName;
}
public function setLastName($lastName)
{
$this->username = $this->firstName . "." . $lastName;
$this->lastName = $lastName;
}
// getters as always
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment