[pLog-svn] Some programming questions?
howard chen
howachen at gmail.com
Tue Mar 4 23:05:55 EST 2008
On Wed, Mar 5, 2008 at 12:00 PM, Mark Wu <markplace at gmail.com> wrote:
> Hi Howard:
>
> All DAO are extended from Model. And the model object include db connection
> and basic CRUD method.
>
> If we change to static method, I am not sure we can do this easily.
>
> Take $blogs->addBlog(xxx) for example, if we change it to static method,
> Blogs::addBlog(xxx), we need to change the method to the following(psuedo
> code)
>
> function addBlog(xxxx) {
> $model = Model::getModelInstance();
> $model->table = Model::assignTable("blogs");
> ....
I think maybe follow the same way as $config is already good enough, e.g.
$articles = Articles::getInstance();
$articles->addArticle(...)
Howard
More information about the pLog-svn
mailing list