--- FreeBSD/tinderbox/webui/core/TinderObject.php 2007/11/02 20:56:34 1.1.1.1 +++ FreeBSD/tinderbox/webui/core/TinderObject.php 2007/11/09 22:56:45 1.1.1.1.2.1 @@ -24,37 +24,27 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # +# +# $Paefchen$ # $MCom: portstools/tinderbox/webui/core/TinderObject.php,v 1.5 2006/01/31 20:31:05 marcus Exp $ # - class TinderObject { - var $_object_hash = array(); - var $_truth_array = array( - "t" => "1", - "f" => "0", - "0" => "0", - "1" => "1", - ); +class TinderObject { + private $_object_hash = array(); + private $_truth_array = array( + 't' => '1', + 'f' => '0', + '0' => '0', + '1' => '1'); - function TinderObject($object_hash, $attrs = array()) { + public function __construct($object_hash, $attrs = array()) { $this->_object_hash = $object_hash; - foreach ($attrs as $key => $value) { - if (isset($this->_object_hash[$key])) { - $this->$key = $value; - } + foreach ($attrs as $key => $value) { + if (isset($this->_object_hash[$key])) + $this->$key = $value; } } +} - function toHashRef() { - $hashref = array(); - - foreach ($this->_object_hash as $key => $value) { - $hashref[$key] = $value; - } - - return $hashref; - } - - } ?>