08-02-2008, 07:16 PM
|
#1 (permalink)
|
|
The Frequenter
Join Date: Dec 2007
Location: In my basement
Posts: 378
Thanks: 45
|
Is this OO Possible? (Method Chaining)
PHP Code:
class MyClass
{
public function instSql()
{
$sql = new Sql;
}
}
class Sql
{
private function Sql() // Constructor
{
// Connect to the database, blah blah blah
return $this;
}
public function Query()
{
// Send a query
return $result;
}
}
// Later...
$cl = new MyClass;
$cl->instSql->Query();
Uhh... That kind of got confusing... Anyway, would something like this work?
__________________
Signatures are nothing but incriminating.
|
|
|