Code Duplication    Length = 8-14 lines in 2 locations

core/db_models/EEM_Base.model.php 2 locations

@@ 4780-4787 (lines=8) @@
4777
    public function field_settings($include_db_only_fields = false)
4778
    {
4779
        if ($include_db_only_fields) {
4780
            if ($this->_cached_fields === null) {
4781
                $this->_cached_fields = array();
4782
                foreach ($this->_fields as $fields_corresponding_to_table) {
4783
                    foreach ($fields_corresponding_to_table as $field_name => $field_obj) {
4784
                        $this->_cached_fields[$field_name] = $field_obj;
4785
                    }
4786
                }
4787
            }
4788
            return $this->_cached_fields;
4789
        } else {
4790
            if ($this->_cached_fields_non_db_only === null) {
@@ 4789-4802 (lines=14) @@
4786
                }
4787
            }
4788
            return $this->_cached_fields;
4789
        } else {
4790
            if ($this->_cached_fields_non_db_only === null) {
4791
                $this->_cached_fields_non_db_only = array();
4792
                foreach ($this->_fields as $fields_corresponding_to_table) {
4793
                    foreach ($fields_corresponding_to_table as $field_name => $field_obj) {
4794
                        /** @var $field_obj EE_Model_Field_Base */
4795
                        if (! $field_obj->is_db_only_field()) {
4796
                            $this->_cached_fields_non_db_only[$field_name] = $field_obj;
4797
                        }
4798
                    }
4799
                }
4800
            }
4801
            return $this->_cached_fields_non_db_only;
4802
        }
4803
    }
4804
4805