Code Duplication    Length = 10-10 lines in 2 locations

model/queries/SQLConditionalExpression.php 2 locations

@@ 652-661 (lines=10) @@
649
	 *
650
	 * @return boolean
651
	 */
652
	public function filtersOnID() {
653
		$regexp = '/^(.*\.)?("|`)?ID("|`)?\s?(=|IN)/';
654
655
		foreach($this->getWhereParameterised($parameters) as $predicate) {
656
			if(preg_match($regexp, $predicate)) return true;
657
		}
658
659
		return false;
660
	}
661
662
	/**
663
	 * Checks whether this query is filtering on a foreign key, ie finding a has_many relationship
664
	 *
@@ 669-678 (lines=10) @@
666
	 *
667
	 * @return boolean
668
	 */
669
	public function filtersOnFK() {
670
		$regexp = '/^(.*\.)?("|`)?[a-zA-Z]+ID("|`)?\s?(=|IN)/';
671
672
		// @todo - Test this works with paramaterised queries
673
		foreach($this->getWhereParameterised($parameters) as $predicate) {
674
			if(preg_match($regexp, $predicate)) return true;
675
		}
676
677
		return false;
678
	}
679
680
	public function isEmpty() {
681
		return empty($this->from);