Code Duplication    Length = 9-9 lines in 2 locations

core/db_models/EEM_CPT_Base.model.php 2 locations

@@ 393-401 (lines=9) @@
390
		$post = (array)$post;
391
		$has_all_necessary_fields_for_table = true;
392
		//check if the post has fields on the meta table already
393
		foreach($this->_get_other_tables() as $table_obj){
394
			$fields_for_that_table = $this->_get_fields_for_table($table_obj->get_table_alias());
395
			foreach($fields_for_that_table as $field_obj){
396
				if( ! isset($post[$field_obj->get_table_column()])
397
					&& ! isset($post[$field_obj->get_qualified_column()])){
398
					$has_all_necessary_fields_for_table = false;
399
				}
400
			}
401
		}
402
		//if we don't have all the fields we need, then just fetch the proper model from the DB
403
		if( ! $has_all_necessary_fields_for_table){
404
@@ 424-432 (lines=9) @@
421
		$post = (array)$post;
422
		$tables_needing_to_be_queried = array();
423
		//check if the post has fields on the meta table already
424
		foreach($this->get_tables() as $table_obj){
425
			$fields_for_that_table = $this->_get_fields_for_table($table_obj->get_table_alias());
426
			foreach($fields_for_that_table as $field_obj){
427
				if( ! isset($post[$field_obj->get_table_column()])
428
					&& ! isset($post[$field_obj->get_qualified_column()])){
429
					$tables_needing_to_be_queried[$table_obj->get_table_alias()] = $table_obj;
430
				}
431
			}
432
		}
433
		//if we don't have all the fields we need, then just fetch the proper model from the DB
434
		if( $tables_needing_to_be_queried){
435
			if(count($tables_needing_to_be_queried) == 1 && reset($tables_needing_to_be_queried) instanceof EE_Secondary_Table){