Code Duplication    Length = 4-4 lines in 2 locations

classes/PodsAPI.php 2 locations

@@ 3190-3193 (lines=4) @@
3187
           unset( $params->data );
3188
        }
3189
3190
		if ( empty( $params->id ) && !in_array( 'created', $fields_active ) && isset( $fields[ 'created' ] ) && in_array( $fields[ 'created' ][ 'type' ], array( 'date', 'datetime' ) ) ) {
3191
			$fields[ 'created' ][ 'value' ] = current_time( 'mysql' );
3192
			$fields_active[] = 'created';
3193
		}
3194
3195
		if ( !in_array( 'modified', $fields_active ) && isset( $fields[ 'modified' ] ) && in_array( $fields[ 'modified' ][ 'type' ], array( 'date', 'datetime' ) ) ) {
3196
			$fields[ 'modified' ][ 'value' ] = current_time( 'mysql' );
@@ 3195-3198 (lines=4) @@
3192
			$fields_active[] = 'created';
3193
		}
3194
3195
		if ( !in_array( 'modified', $fields_active ) && isset( $fields[ 'modified' ] ) && in_array( $fields[ 'modified' ][ 'type' ], array( 'date', 'datetime' ) ) ) {
3196
			$fields[ 'modified' ][ 'value' ] = current_time( 'mysql' );
3197
			$fields_active[] = 'modified';
3198
		}
3199
3200
        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' ] ] ) ) {
3201
			$fields[ $pod[ 'pod_field_slug' ] ][ 'value' ] = ''; // this will get picked up by slug pre_save method