Code Duplication    Length = 4-4 lines in 2 locations

classes/PodsAPI.php 2 locations

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