/** * @param ServiceGroup $otherObject * @return bool true if both objects contain same objects names */ public function sameValue(ServiceGroup $otherObject) { if ($this->isTmpSrv() && !$otherObject->isTmpSrv()) { return false; } if ($otherObject->isTmpSrv() && !$this->isTmpSrv()) { return false; } if ($otherObject->count() != $this->count()) { return false; } $lO = array(); $oO = array(); foreach ($this->members as $a) { $lO[] = $a->name(); } sort($lO); foreach ($otherObject->members as $a) { $oO[] = $a->name(); } sort($oO); $diff = array_diff($oO, $lO); if (count($diff) != 0) { return false; } $diff = array_diff($lO, $oO); if (count($diff) != 0) { return false; } return true; }