protected function _update( $args, $assoc_args, $callback ) {
		$status = 0;

		if ( empty( $assoc_args ) ) {
			WP_CLI::error( 'Need some fields to update.' );
		}

		if ( Utils\get_flag_value( $assoc_args, 'defer-term-counting' ) ) {
			wp_defer_term_counting( true );
		}

		foreach ( $args as $obj_id ) {
			$params = array_merge( $assoc_args, [ $this->obj_id_key => $obj_id ] );

			$status = $this->success_or_failure(
				$this->wp_error_to_resp(
					$callback( $params ),
					"Updated {$this->obj_type} {$obj_id}."
				)
			);
		}

		if ( Utils\get_flag_value( $assoc_args, 'defer-term-counting' ) ) {
			wp_defer_term_counting( false );
		}

		exit( $status );
	}
protected function _update( $args, $assoc_args, $callback ) {
		$status = 0;

		if ( empty( $assoc_args ) ) {
			WP_CLI::error( 'Need some fields to update.' );
		}

		if ( Utils\get_flag_value( $assoc_args, 'defer-term-counting' ) ) {
			wp_defer_term_counting( true );
		}

		foreach ( $args as $obj_id ) {
			$params = array_merge( $assoc_args, [ $this->obj_id_key => $obj_id ] );

			$status = $this->success_or_failure(
				$this->wp_error_to_resp(
					$callback( $params ),
					"Updated {$this->obj_type} {$obj_id}."
				)
			);
		}

		if ( Utils\get_flag_value( $assoc_args, 'defer-term-counting' ) ) {
			wp_defer_term_counting( false );
		}

		exit( $status );
	}
protected function _update ( $ args , $ assoc_args , $ callback ) { $ status = 0 ; if ( empty ( $ assoc_args ) ) { WP_CLI :: error ( 'Need some fields to update.' ) ; } if ( Utils \ get_flag_value ( $ assoc_args , 'defer-term-counting' ) ) { wp_defer_term_counting ( true ) ; } foreach ( $ args as $ obj_id ) { $ params = array_merge ( $ assoc_args , [ $ this -> obj_id_key => $ obj_id ] ) ; $ status = $ this -> success_or_failure ( $ this -> wp_error_to_resp ( $ callback ( $ params ) , "Updated {$this->obj_type} {$obj_id}." ) ) ; } if ( Utils \ get_flag_value ( $ assoc_args , 'defer-term-counting' ) ) { wp_defer_term_counting ( false ) ; } exit ( $ status ) ; }
Update a given database object.
Exits with status.

@param array $args Collection of one or more object ids to update.
@param array $assoc_args Fields => values to update on each object.
@param string $callback Function used to update object.
Update a given database object . Exits with status .