APPNETOS is under active development This website and its documentation are being prepared for public launch. Content and features may change.
Select Theme
Loading

CallObject

Inject the result of a Registry-resolved method call.

Purpose & processing

Obtains the object through the Registry and invokes the configured method; the returned value becomes the property value.

Parameters

ParameterTypeDefaultBehavior
classstringRequiredClass to resolve through the Registry.
methodstringRequiredMethod to invoke on the resolved object.
parametersarray[]Arguments passed to the invoked method.

Example

#[CallObject(MyService::class, 'getTitle', ['home'])]
protected string|null $title = null;

Behavior and considerations

  • A missing method raises RegistryException; it is not silently converted to null.
  • The invoked method itself may return null.
  • Existing non-null property values are preserved.

Source

shared/src/Core/Annotation/CallObject.php

Next Steps

Previous

Autowire

Explore Autowire

Next

Configuration & Runtime

Explore Configuration & Runtime