Re: Re: [PEPr] +1 for File Formats::File_CSV_Get
| From: | kazuyoshi tlacaelel | Date: | Tue, 02 Dec 2008 05:37:09 +0000 |
| Subject: | Re: Re: [PEPr] +1 for File Formats::File_CSV_Get | ||
| References: | 1 2 3 4 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-51199@lists.php.net to get a copy of this message | ||
Thanks Michael, yup the changes you mention sound good to me too!
On Tue, Dec 2, 2008 at 11:28 AM, Michael Gauthier <mike@silverorange.com>wrote:
> On Tue, 2008-12-02 at 09:01 +0900, kazuyoshi tlacaelel wrote:
> > Thanks for the votes ; )
> >
> > Christian, Till. how is this sound?
> >
> > column > getColumn
> > headers > getHeaders
> > row > getRow
> > rows > getRows
> > cell > getCell
> > uses > load (also loadable as an optional argument in the contructor
> method)
> > rawArray > getRawArray()
>
>
> Sounds good. I'd also suggest renaming:
>
> coordinatable() => hasCell()
> injectHeaders() => setHeaders()
> symmetric() => isSymmetric()
> settings() => setConfig()
> asymmetry() => getAsymmetricRows()
>
> It would also be nice to be able to optionally pass in the config array
> from setConfig() in the constructor you are making.
>
> Also, is connect() (which is a confusing method name) the same as
> getRows() with no range specified? If so, the connect() method should be
> dropped.
>
the differences between connect and rows is that connect builds a connection
per each row and its corresponding header
1. array (
2. 0 =>
3. array (
4. 'name' => 'john',
5. 'age' => '13',
6. 'skill' => 'knows magic',
7. ),
8. 1 =>
9. array (
10. 'name' => 'tanaka',
11. 'age' => '8',
12. 'skill' => 'makes sushi',
13. ),
14. 2 =>
15. array (
16. 'name' => 'jose',
17. 'age' => '5',
18. 'skill' => 'dances salsa',
19. ),
20. )
and rows() just gets the data of the rows
1. array (
2. 0 =>
3. array (
4. 0 => 'john',
5. 1 => '13',
6. 2 => 'knows magic',
7. ),
8. 1 =>
9. array (
10. 0 => 'tanaka',
11. 1 => '8',
12. 2 => 'makes sushi',
13. ),
14. 2 =>
15. array (
16. 0 => 'jose',
17. 1 => '5',
18. 2 => 'dances salsa',
19. ),
20. )
Lastly, is this package intended to be used at all without CSV headers?
you could use connect() to build a query for example or use headers()
to simply get a list of headers retrived from the csv in an array.
You have my conditional vote as well.
>
> Cheers,
>
>
> Mike
>
>
Thanks for your vote Michael, I agree with the names that you suggested!