Simplest way to extend doctrine for MVC Models
- by RobertPitt
Im developing my own framework that uses namespaces.
Doctrine is already integrated into my auto loading system and im now at the stage where ill be creating the model system for my application
Usually i would create a simple model like so:
namespace Application\Models;
class Users extends \Framework\Models\Database{}
which would inherit all the default database model methods, But with Doctrine im still learning how it all works, as its not just a simple DBAL.
I need to understand whats the part of doctrine my classes would extend where i can do the following:
namespace Application\Models;
class Users Extends Doctrine\Something\Table
{
public $__table_name = "users";
}
And thus within the controller i would be able to do the following:
public function Display($uid)
{
$User = $this->Model->Users->findOne(array("id" => (int)$id));
}
Anyone help me get my head around this ?