Oihana PHP Arango

DocumentsCommandTruncate uses trait:short

Table of Contents

Properties

$documents  : Documents|null
The DocumentsModel instance for data operations.
$excludes  : array<string|int, mixed>|mixed|null
A list of properties to exclude during data manipulation operations like insert, update, replace, or upsert.
$fields  : array<string|int, mixed>
The document's fields to display in tabular output.
$removeKeys  : array<string|int, mixed>|mixed|null
A list of properties to remove during data manipulation operations like insert, update, replace, or upsert.

Methods

assertDocuments()  : void
Asserts that the 'documents' property has been initialized.
fetchDocuments()  : array<string|int, mixed>
Fetch all documents from the OpenEdge database.
initializeDocuments()  : static
Initializes the 'documents' property.
outputDocuments()  : void
Renders a list of documents to the console output.
truncate()  : int
Truncate the collection and remove all documents.

Properties

$excludes

A list of properties to exclude during data manipulation operations like insert, update, replace, or upsert.

public array<string|int, mixed>|mixed|null $excludes = null

$fields

The document's fields to display in tabular output.

public array<string|int, mixed> $fields = [\org\schema\constants\Schema::_KEY, \org\schema\constants\Schema::NAME, \org\schema\constants\Schema::CREATED, \org\schema\constants\Schema::MODIFIED]

$removeKeys

A list of properties to remove during data manipulation operations like insert, update, replace, or upsert.

public array<string|int, mixed>|mixed|null $removeKeys = null

Methods

assertDocuments()

Asserts that the 'documents' property has been initialized.

protected assertDocuments() : void
Tags
throws
UnexpectedValueException

If the 'documents' property is not set.

fetchDocuments()

Fetch all documents from the OpenEdge database.

protected fetchDocuments(OutputInterface $output[, Documents|null $ref = null ][, string $name = 'documents' ][, array<string|int, mixed> $init = [] ]) : array<string|int, mixed>
Parameters
$output : OutputInterface

The console output instance.

$ref : Documents|null = null

The optional Documents reference to use (default, use $this->documents)

$name : string = 'documents'

The optional name of the documents (default "documents").

$init : array<string|int, mixed> = []

An associative array of optional settings to define the query - Documents::list().

Tags
throws
BindException
ContainerExceptionInterface
ArangoException
NotFoundExceptionInterface
ReflectionException
Return values
array<string|int, mixed>

initializeDocuments()

Initializes the 'documents' property.

protected initializeDocuments([array<string|int, mixed> $init = [] ][, ContainerInterface|null $container = null ]) : static

This method attempts to find a service name in the '$init' array and uses the provided PSR container to retrieve the DocumentsModel instance.

Parameters
$init : array<string|int, mixed> = []

An array of initialization parameters, expected to contain the documents service name.

$container : ContainerInterface|null = null

An optional PSR-11 container for service resolution.

Tags
throws
ContainerExceptionInterface

If an error occurs while retrieving the entry from the container.

NotFoundExceptionInterface

If no entry was found in the container for the given service name.

Return values
static

The instance of the class using this trait, for method chaining.

outputDocuments()

Renders a list of documents to the console output.

protected outputDocuments(array<string|int, mixed> $documents, InputInterface $input, OutputInterface $output[, array<string|int, mixed>|null $fields = null ]) : void

The output format is determined by the verbosity level:

  • Default: Displays the total count of documents found.
  • Verbose (-v): Renders a table with the fields defined in the $this->fields property.
  • Very Verbose (-vv): Outputs the full documents as a prettyprint JSON array.
Parameters
$documents : array<string|int, mixed>

The array of document objects to display.

$input : InputInterface

The console input instance.

$output : OutputInterface

The console output instance.

$fields : array<string|int, mixed>|null = null

The optional fields to display (by default, use the $this->fields property).

truncate()

Truncate the collection and remove all documents.

protected truncate(InputInterface $input, OutputInterface $output[, mixed|null $option = null ]) : int
Parameters
$input : InputInterface
$output : OutputInterface
$option : mixed|null = null
Return values
int
On this page

Search results