Code Duplication    Length = 8-14 lines in 2 locations

core/db_models/EEM_Base.model.php 2 locations

@@ 3998-4005 (lines=8) @@
3995
	 */
3996
	public function field_settings($include_db_only_fields = false){
3997
		if( $include_db_only_fields ){
3998
			if( $this->_cached_fields === NULL ){
3999
				$this->_cached_fields = array();
4000
				foreach($this->_fields as $fields_corresponding_to_table){
4001
					foreach($fields_corresponding_to_table as $field_name => $field_obj){
4002
						$this->_cached_fields[$field_name]=$field_obj;
4003
					}
4004
				}
4005
			}
4006
			return $this->_cached_fields;
4007
		}else{
4008
			if( $this->_cached_fields_non_db_only === NULL ){
@@ 4007-4020 (lines=14) @@
4004
				}
4005
			}
4006
			return $this->_cached_fields;
4007
		}else{
4008
			if( $this->_cached_fields_non_db_only === NULL ){
4009
				$this->_cached_fields_non_db_only = array();
4010
				foreach($this->_fields as $fields_corresponding_to_table){
4011
					foreach($fields_corresponding_to_table as $field_name => $field_obj){
4012
						/** @var $field_obj EE_Model_Field_Base */
4013
						if( ! $field_obj->is_db_only_field() ){
4014
							$this->_cached_fields_non_db_only[$field_name]=$field_obj;
4015
						}
4016
					}
4017
				}
4018
			}
4019
			return $this->_cached_fields_non_db_only;
4020
		}
4021
	}
4022
4023