bst/webapp/mocha/core/InstanceSet.inc.php
2023-10-31 00:21:50 -04:00

31 lines
467 B
PHP

<?php
namespace Mocha\Core;
class InstanceSet
{
private $_Instances;
public function __construct()
{
$this->_Instances = array();
}
public function add($inst)
{
$this->_Instances[] = $inst;
}
public function contains($inst)
{
foreach ($this->_Instances as $needle)
{
if ($needle === $inst)
return true;
}
/*
if (in_array($inst, $this->_Instances))
trigger_error("needle is equal to inst");
return true;
*/
return false;
}
}