11-12-2008, 07:28 PM
|
#1 (permalink)
|
|
The Prestige
Join Date: Sep 2007
Location: Sweden, Stockholm
Posts: 1,080
Thanks: 115
|
Return self ?
Hi!
You know when you want to use chains in regular classes, you return $this?
PHP Code:
public function smthng() {
$this->somevar = 'smthng'; return $this;
}
My question regards how you do this when the whole class is static(it's a factory)?
PHP Code:
public static function smthng() {
self::$somevar = 'smthng'; return self;
}
??
Also, if this is possible, how does the actual chaining work?
I mean.. do you use it like:
PHP Code:
FACTORY::smthng()::smthng()::smthng;
??
__________________
|
|
|
|