Code Duplication    Length = 8-14 lines in 2 locations

core/db_models/EEM_Base.model.php 2 locations

@@ 3569-3576 (lines=8) @@
3566
	 */
3567
	public function field_settings($include_db_only_fields = false){
3568
		if( $include_db_only_fields ){
3569
			if( $this->_cached_fields === NULL ){
3570
				$this->_cached_fields = array();
3571
				foreach($this->_fields as $fields_corresponding_to_table){
3572
					foreach($fields_corresponding_to_table as $field_name => $field_obj){
3573
						$this->_cached_fields[$field_name]=$field_obj;
3574
					}
3575
				}
3576
			}
3577
			return $this->_cached_fields;
3578
		}else{
3579
			if( $this->_cached_fields_non_db_only === NULL ){
@@ 3578-3591 (lines=14) @@
3575
				}
3576
			}
3577
			return $this->_cached_fields;
3578
		}else{
3579
			if( $this->_cached_fields_non_db_only === NULL ){
3580
				$this->_cached_fields_non_db_only = array();
3581
				foreach($this->_fields as $fields_corresponding_to_table){
3582
					foreach($fields_corresponding_to_table as $field_name => $field_obj){
3583
						/** @var $field_obj EE_Model_Field_Base */
3584
						if( ! $field_obj->is_db_only_field() ){
3585
							$this->_cached_fields_non_db_only[$field_name]=$field_obj;
3586
						}
3587
					}
3588
				}
3589
			}
3590
			return $this->_cached_fields_non_db_only;
3591
		}
3592
	}
3593
3594