Code Duplication    Length = 4-4 lines in 2 locations

classes/PodsAPI.php 2 locations

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