Code Duplication    Length = 4-4 lines in 2 locations

classes/PodsAPI.php 2 locations

@@ 3217-3220 (lines=4) @@
3214
           unset( $params->data );
3215
        }
3216
3217
		if ( empty( $params->id ) && !in_array( 'created', $fields_active ) && isset( $fields[ 'created' ] ) && in_array( $fields[ 'created' ][ 'type' ], array( 'date', 'datetime' ) ) ) {
3218
			$fields[ 'created' ][ 'value' ] = current_time( 'mysql' );
3219
			$fields_active[] = 'created';
3220
		}
3221
3222
		if ( !in_array( 'modified', $fields_active ) && isset( $fields[ 'modified' ] ) && in_array( $fields[ 'modified' ][ 'type' ], array( 'date', 'datetime' ) ) ) {
3223
			$fields[ 'modified' ][ 'value' ] = current_time( 'mysql' );
@@ 3222-3225 (lines=4) @@
3219
			$fields_active[] = 'created';
3220
		}
3221
3222
		if ( !in_array( 'modified', $fields_active ) && isset( $fields[ 'modified' ] ) && in_array( $fields[ 'modified' ][ 'type' ], array( 'date', 'datetime' ) ) ) {
3223
			$fields[ 'modified' ][ 'value' ] = current_time( 'mysql' );
3224
			$fields_active[] = 'modified';
3225
		}
3226
3227
        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' ] ] ) ) {
3228
			$fields[ $pod[ 'pod_field_slug' ] ][ 'value' ] = ''; // this will get picked up by slug pre_save method