Code Duplication    Length = 4-4 lines in 2 locations

classes/PodsAPI.php 2 locations

@@ 3205-3208 (lines=4) @@
3202
           unset( $params->data );
3203
        }
3204
3205
		if ( empty( $params->id ) && !in_array( 'created', $fields_active ) && isset( $fields[ 'created' ] ) && in_array( $fields[ 'created' ][ 'type' ], array( 'date', 'datetime' ) ) ) {
3206
			$fields[ 'created' ][ 'value' ] = current_time( 'mysql' );
3207
			$fields_active[] = 'created';
3208
		}
3209
3210
		if ( !in_array( 'modified', $fields_active ) && isset( $fields[ 'modified' ] ) && in_array( $fields[ 'modified' ][ 'type' ], array( 'date', 'datetime' ) ) ) {
3211
			$fields[ 'modified' ][ 'value' ] = current_time( 'mysql' );
@@ 3210-3213 (lines=4) @@
3207
			$fields_active[] = 'created';
3208
		}
3209
3210
		if ( !in_array( 'modified', $fields_active ) && isset( $fields[ 'modified' ] ) && in_array( $fields[ 'modified' ][ 'type' ], array( 'date', 'datetime' ) ) ) {
3211
			$fields[ 'modified' ][ 'value' ] = current_time( 'mysql' );
3212
			$fields_active[] = 'modified';
3213
		}
3214
3215
        if ( in_array( $pod[ 'type' ], array( 'pod', 'table' ) ) && empty( $params->id ) && !empty( $pod[ 'pod_field_index' ] ) && in_array( $pod[ 'pod_field_index' ], $fields_active ) && !in_array( $pod[ 'pod_field_slug' ], $fields_active ) && isset( $fields[ $pod[ 'pod_field_slug' ] ] ) ) {
3216
			$fields[ $pod[ 'pod_field_slug' ] ][ 'value' ] = ''; // this will get picked up by slug pre_save method