Writing a model for a user (php)
<p>I have a users model that has a lot of properties such as first_name, last_name, email, address, address2...etc</p>

<p>I am writing a php class to manage these properties, but it seems like I am writing a lot of the same code. (Getters and setters). Should I use magic methods to manage this? It seems like an OK idea, but I don't want incorrect properties being set. Any ideas?</p>

<pre><code>&lt;?php
class User
{
    private $username;
    private $email
    private $first_name;
    private $last_name;
    private $address;
    private $address2;

    function __construct()
    {

    }

        function getUsername()
        {
            return $this-&gt;username
        }


        function setUsername($username)
        {
            $this-&gt;username = $username;
        }

        ...
}
?&gt;
</code></pre>
