public function __get($key) { switch ($key) { case 'name': return $this->category; case 'id': return $this->categoryid; case 'parent': return ProductCategory($this->parent); case 'children': return $this->children; default: return $this->ambient[$key]; } }
static function getCategories() { return ProductCategory(0); }