Re: DB_DataObject and Structures_DataGrid integration

From: Date: Fri, 13 Aug 2004 18:02:41 +0000
Subject: Re: DB_DataObject and Structures_DataGrid integration
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-32640@lists.php.net to get a copy of this message
Olivier Guilyardi wrote:
So I guess that the developer has to directly do : $datasource = new Structures_DataGrid_Source_DataObject($dataobject); Is that right ?
Yep.
That's ok with me, although I don't see no decorator pattern below. Additionnaly, why does S_DG_S_DO::fetch($source) accept this $source argument ? It already knows its source...
Never mind that :) It shouldn't be there. The code below is just a brainstorm.
class Structures_DataGrid_Source_DataObject extends Structures_DataGrid_Source {
    function Structures_DataGrid_Source_DataObject($source)
    {
        parent::Structures_DataGrid_Source($source);
    }
    function fetch($source)
    {
    }
    function clear()
    {
    }
    function autoGenerateColumns()
    {
    }
} class Structures_DataGrid_Source {
    var $source;
    function Structures_DataGrid_Source($source)
    {
         $this->source = $source;
    }
    function fetch()
    {
    }
    function clear()
    {
    }
} My only request, please don't use one letter variables! I hate them and it makes sense to the creator but means jack to anyone else :)
No problem. I like to use one letter variables in both PHP and C, within short functions, but I agree it's sometime confusing. I'll read the PEAR coding standards again ;)
I don't think it's in the coding standards, but it probably should be. I just hate it no matter what language.

« previous php.pear.dev (#32640) next »