Code Duplication    Length = 13-13 lines in 2 locations

core/db_models/EEM_Base.model.php 2 locations

@@ 1025-1037 (lines=13) @@
1022
	 * @return EE_Base_Class | NULL
1023
	 * @throws \EE_Error
1024
	 */
1025
	public function get_one($query_params = array()){
1026
		if( ! is_array( $query_params ) ){
1027
			EE_Error::doing_it_wrong('EEM_Base::get_one', sprintf( __( '$query_params should be an array, you passed a variable of type %s', 'event_espresso' ), gettype( $query_params ) ), '4.6.0' );
1028
			$query_params = array();
1029
		}
1030
		$query_params['limit'] = 1;
1031
		$items = $this->get_all($query_params);
1032
		if(empty($items)){
1033
			return null;
1034
		}else{
1035
			return array_shift($items);
1036
		}
1037
	}
1038
1039
1040
@@ 4687-4699 (lines=13) @@
4684
	 * @return EE_Base_Class
4685
	 * @throws \EE_Error
4686
	 */
4687
	public function get_one_copy($model_object_or_attributes_array,$query_params = array()){
4688
		if( ! is_array( $query_params ) ){
4689
			EE_Error::doing_it_wrong('EEM_Base::get_one_copy', sprintf( __( '$query_params should be an array, you passed a variable of type %s', 'event_espresso' ), gettype( $query_params ) ), '4.6.0' );
4690
			$query_params = array();
4691
		}
4692
		$query_params['limit'] = 1;
4693
		$copies = $this->get_all_copies($model_object_or_attributes_array,$query_params);
4694
		if(is_array($copies)){
4695
			return array_shift($copies);
4696
		}else{
4697
			return null;
4698
		}
4699
	}
4700
4701
4702