Guest190829
08-06-2005, 04:46 AM
OOP is giving me a headache. I'm working on vbspace, and I'm just messing around with the space class...is this correct for the most part? It's not the full class just one function
<?php
class space //myspace class: the backbone of the hack.
{
var $type;
var $cache;
public function get_soptions()
{
$options = $db->query_read("SELECT * from " . TABLE_PREFIX . " space_options");
while ($soptions = $db->fetch_array($options))
{
$this->type = $soptions[type];
$this->cache = $soptions[cache];
}
}
}
?>
If not, can you explain what $this-> is? I'm seeing it everywhere, and I think I have it right. It's just a pseudo instance of a the current class. Am I right?
<?php
class space //myspace class: the backbone of the hack.
{
var $type;
var $cache;
public function get_soptions()
{
$options = $db->query_read("SELECT * from " . TABLE_PREFIX . " space_options");
while ($soptions = $db->fetch_array($options))
{
$this->type = $soptions[type];
$this->cache = $soptions[cache];
}
}
}
?>
If not, can you explain what $this-> is? I'm seeing it everywhere, and I think I have it right. It's just a pseudo instance of a the current class. Am I right?