Static functions in PHP?

I think I missed something in my PHP journey. Are there no static object methods in PHP (prior to 5, which I haven't even looked into yet)? I'm trying to wrap objects around my DB tables and giving each a select($id) method that is called on the class level and returns an instance... IE:

[code]$myAcct = Accounts->Select($id);[/code]

Is that not possible? Is there a workaround that's not more complicated than it's worth? I'm trying to avoid a DB wrapper class that's nothing but a series of variously named functions like selectAccount($id), selectUser($id), ...

Any help would be appreciated.

T

Comments

: Hey,: : I think I missed something in my PHP journey. Are there no static object methods in PHP (prior to 5, which I haven't even looked into yet)? I'm trying to wrap objects around my DB tables and giving each a select($id) method that is called on the class level and returns an instance... IE:: : [code]$myAcct = Accounts->Select($id);[/code]: : Is that not possible? Is there a workaround that's not more complicated than it's worth? I'm trying to avoid a DB wrapper class that's nothing but a series of variously named functions like selectAccount($id), selectUser($id), ...: : Any help would be appreciated.: : T: use [code]Accounts::Select($id)[/code] as Select is a static function.

That's great! Such a simple thing makes such a big difference to my design. Thank you very much for your help.

T

: : Hey,: : : : I think I missed something in my PHP journey. Are there no static object methods in PHP (prior to 5, which I haven't even looked into yet)? I'm trying to wrap objects around my DB tables and giving each a select($id) method that is called on the class level and returns an instance... IE:: : : : [code]$myAcct = Accounts->Select($id);[/code]: : : : Is that not possible? Is there a workaround that's not more complicated than it's worth? I'm trying to avoid a DB wrapper class that's nothing but a series of variously named functions like selectAccount($id), selectUser($id), ...: : : : Any help would be appreciated.: : : : T: : : use [code]Accounts::Select($id)[/code] as Select is a static function.: