I know, this must have been asked a 1000 times before (if not more), but I just cant seem to get it..
The behaviour of this example seems a bit odd to me.
The problem:
I want to use the delete function on __destruct(). Can be done by calling self::delete(). And when it finally gets there, $this->uid doesnt exists any more.
Why ?
abstract class ARO {
protected $uid = null;
protected function __construct() {
}
protected function __destruct() {
self::delete();
}
public function delete() {
// delete from db using $this->uid
}
}
abstract class ARO_USR extends ARO {
public function __construct() {
}
public function __destruct() {
parent::__destruct();
}
}
class user extends ARO_USR {
}not relevant anymore.
The behaviour of this example seems a bit odd to me.
The problem:
I want to use the delete function on __destruct(). Can be done by calling self::delete(). And when it finally gets there, $this->uid doesnt exists any more.
Why ?
abstract class ARO {
protected $uid = null;
protected function __construct() {
}
protected function __destruct() {
self::delete();
}
public function delete() {
// delete from db using $this->uid
}
}
abstract class ARO_USR extends ARO {
public function __construct() {
}
public function __destruct() {
parent::__destruct();
}
}
class user extends ARO_USR {
}not relevant anymore.