Is this a good way for Controller to interact with Model ? (MVC) In my controller I had the idea to do something like the following:

// retrieve fields from form
$firstname = $form-&gt;getInput('firstname');
$lastname = $form-&gt;getInput('lastname');
[...]
// create Member object
$member = new Member($firstname, $lastname, [...]);
// save Member in DB
$this-&gt;_daoFactory-&gt;get('Member')-&gt;save($member);


In this example, the DAO factory would create an instance of the MemberDAO class, which (I guess) acts like a data mapper? And allows me to save the Member object in DB, to update a Member, get a Member from id, and other db requests probably.

What do you think about this code?

Thank you for your review!
A lot of MVC frameworks do the datamapping in the same class (usually with static methods).  I would also avoid creating hard links between controllers and models (like having each model property as a parameter in the class constructor).  Something like this is a little more elegant, IMO:

&lt;?php

// Model
class Member
{
    public static function forge(array $data = array())
    {
        return new static($data);
    }

    public function __construct(array $data = array())
    {
        foreach ($data as $k =&gt; $v)
        {
            // consider checking here for expected properties,
            // sanitizing input, etc.
            $this-&gt;$k = $v;
        }
    }

    public function save()
    {
        // If primary key exists, run DB update query
        // Otherwise, run insert query

        // Return success/failure information (and/or throw exceptions)
    }
}

// Controller action
$member = Member::forge($form-&gt;get_sanitized_postdata());
$member-&gt;save();