so i want to follow the mvc conventions but haven't really got the hang of it.
i've got problem understanding the explicit difference between a model and a library class and how they relate to each other.
eg. i want to create classes to add/edit contacts and also adding them to a group.
i thought it should be divided into 2 classes: Contact and Group.
The first class would create a contact. The other one will add the contact to a group. I thought this dividing would be perfect cause their logic is isolated from each others. Contact doesn't care if Group exists or not. Group doesn't care about how a Contact looks like.
So Contact will have these methods:
$Contact->add($name, $email, $address, $phone) // create an entry in database
$Contact->delete($id) // delete the entry in database
$Contact->edit($id, $name, $email, $address, $phone) // edit the entry in database
And Group:
$Group->createGroup($name) // create a group in database
$Group->delete($id) // delete a group in database
$Group->addContact($groupId, $contactId) // add a contact to a group in database
So these classes apparently work with the database. Does this mean that these are models? Or are they library classes that eg. should be put in SYSTEM/LIBRARIES in CodeIgniter. If it's the latter one, how do a Model in this case looks like using the classes?
And how would a controller look like in this scenario?
Would be great if someone could give me the big picture! Thanks!