Code Duplication    Length = 8-14 lines in 2 locations

core/db_models/EEM_Base.model.php 2 locations

@@ 4011-4018 (lines=8) @@
4008
	 */
4009
	public function field_settings($include_db_only_fields = false){
4010
		if( $include_db_only_fields ){
4011
			if( $this->_cached_fields === NULL ){
4012
				$this->_cached_fields = array();
4013
				foreach($this->_fields as $fields_corresponding_to_table){
4014
					foreach($fields_corresponding_to_table as $field_name => $field_obj){
4015
						$this->_cached_fields[$field_name]=$field_obj;
4016
					}
4017
				}
4018
			}
4019
			return $this->_cached_fields;
4020
		}else{
4021
			if( $this->_cached_fields_non_db_only === NULL ){
@@ 4020-4033 (lines=14) @@
4017
				}
4018
			}
4019
			return $this->_cached_fields;
4020
		}else{
4021
			if( $this->_cached_fields_non_db_only === NULL ){
4022
				$this->_cached_fields_non_db_only = array();
4023
				foreach($this->_fields as $fields_corresponding_to_table){
4024
					foreach($fields_corresponding_to_table as $field_name => $field_obj){
4025
						/** @var $field_obj EE_Model_Field_Base */
4026
						if( ! $field_obj->is_db_only_field() ){
4027
							$this->_cached_fields_non_db_only[$field_name]=$field_obj;
4028
						}
4029
					}
4030
				}
4031
			}
4032
			return $this->_cached_fields_non_db_only;
4033
		}
4034
	}
4035
4036