Code Duplication    Length = 8-14 lines in 2 locations

core/db_models/EEM_Base.model.php 2 locations

@@ 4741-4748 (lines=8) @@
4738
    public function field_settings($include_db_only_fields = false)
4739
    {
4740
        if ($include_db_only_fields) {
4741
            if ($this->_cached_fields === null) {
4742
                $this->_cached_fields = array();
4743
                foreach ($this->_fields as $fields_corresponding_to_table) {
4744
                    foreach ($fields_corresponding_to_table as $field_name => $field_obj) {
4745
                        $this->_cached_fields[$field_name] = $field_obj;
4746
                    }
4747
                }
4748
            }
4749
            return $this->_cached_fields;
4750
        } else {
4751
            if ($this->_cached_fields_non_db_only === null) {
@@ 4750-4763 (lines=14) @@
4747
                }
4748
            }
4749
            return $this->_cached_fields;
4750
        } else {
4751
            if ($this->_cached_fields_non_db_only === null) {
4752
                $this->_cached_fields_non_db_only = array();
4753
                foreach ($this->_fields as $fields_corresponding_to_table) {
4754
                    foreach ($fields_corresponding_to_table as $field_name => $field_obj) {
4755
                        /** @var $field_obj EE_Model_Field_Base */
4756
                        if (! $field_obj->is_db_only_field()) {
4757
                            $this->_cached_fields_non_db_only[$field_name] = $field_obj;
4758
                        }
4759
                    }
4760
                }
4761
            }
4762
            return $this->_cached_fields_non_db_only;
4763
        }
4764
    }
4765
4766