Builder::output( string $output = OBJECT )

Sets the output format that should be used to format the result(s) of a SELECT Model query.


Parameters

$output

(string) (Optional) One of OBJECT, ARRAY_A or ARRAY_N. Note that OBJECT will build and return instances of the Model.

Default value: OBJECT


Top ↑

Return

($this) A reference to the query builder object, for chaining purposes.


Top ↑

Source

File: src/Events/Custom_Tables/V1/Models/Builder.php

	public function output( $output = OBJECT ) {
		if ( ! in_array( $output, [ OBJECT, ARRAY_A, ARRAY_N ], true ) ) {
			throw new InvalidArgumentException( 'Output not supported, use one of ARRAY_A, ARRAY_N or OBJECT.' );
		}

		$this->output_format = $output;

		return $this;
	}

Top ↑

Changelog

Changelog
Version Description
6.0.0 Introduced.