$testRange0->setMaximum(7); $val = $testRange0->getMaximum(); } catch (\Exception $e) { $success = false; } if ($success) { echo "Success!\n"; } else { echo "Failure...\n"; } echo "Set Minimum (1) -> "; $success = true; $val = null; try { $testRange0->setMinimum(1); $val = $testRange0->getMinimum(); } catch (\Exception $e) { $success = false; } if ($success) { echo "Success!\n"; } else { echo "Failure...\n"; } echo "Is In Range (3) -> "; try { if ($testRange0->isInRange(3)) { echo "Yes\n"; } else { echo "No\n"; }
/** * Get A Range Of Indexes * * This gets an array of objects that have priorities between ranges * * NOTE: The utility function must be used because of incompatibility * of array_unique algorithm * * @param Falcraft\Data\Types\Range $r The range to include * * @return array The appropriate array * */ public function indexRange(Range $r) { return StandardResource\ArrayUtilities::returnUnique(array_merge($this->index($r->getMinimum(), self::HIGHER), $this->index($r->getMaximum(), self::LOWER))); }