where('RuleID', $ruleID) ->where('EndDate IS NULL') ->findAll(); } /** * Get all active rules mapped to a test site * * @param int $testSiteID The test site ID * @return array Array of mappings */ public function getByTestSiteID(int $testSiteID): array { return $this->where('TestSiteID', $testSiteID) ->where('EndDate IS NULL') ->findAll(); } /** * Check if a rule is linked to a test site * * @param int $ruleID The rule ID * @param int $testSiteID The test site ID * @return bool True if linked and active */ public function isLinked(int $ruleID, int $testSiteID): bool { return $this->where('RuleID', $ruleID) ->where('TestSiteID', $testSiteID) ->where('EndDate IS NULL') ->countAllResults() > 0; } }