Builder::output( string $output = OBJECT )
Sets the output format that should be used to format the result(s) of a SELECT Model query.
Contents
Parameters
- $output
-
(string) (Optional) One of
OBJECT,ARRAY_AorARRAY_N. Note thatOBJECTwill build and return instances of the Model.Default value: OBJECT
Return
($this) A reference to the query builder object, for chaining purposes.
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;
}
Changelog
| Version | Description |
|---|---|
| 6.0.0 | Introduced. |