OO php: static and factory classes

Charles Curley charlescurley at charlescurley.com
Fri Aug 31 16:06:25 MDT 2007


On Fri, Aug 31, 2007 at 03:43:42PM -0600, Kirk Cerny wrote:
> I thought you called static with the scope oporator
> 
> $countImages = ClassName::imageCount ($client_id, $db, __LINE__, __FILE__);

That was one of two problems:

// $snark = new Images ();
$countImages = Images::imageCount ($client_id, $db, __LINE__, __FILE__);

I should have used the :: operator, and no leading $ on the class name.

Thanks


> >
> > $snark = new Images ();
> > $countImages = $snark->imageCount ($client_id, $db, __LINE__, __FILE__);
> >
> >
> > but this does not:
> >
> > $countImages = $Images->imageCount ($client_id, $db, __LINE__, __FILE__);
> >

-- 

Charles Curley                  /"\    ASCII Ribbon Campaign
Looking for fine software       \ /    Respect for open standards
and/or writing?                  X     No HTML/RTF in email
http://www.charlescurley.com    / \    No M$ Word docs in email

Key fingerprint = CE5C 6645 A45A 64E4 94C0  809C FFF6 4C48 4ECD DFDB
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://plug.org/pipermail/plug/attachments/20070831/21f2e237/attachment.bin 


More information about the PLUG mailing list