mini\metadata()
Function
Documentation
Get or create a Metadata instance
With no arguments: Returns a new Metadata for building annotations. With class name: Returns metadata built from class attributes (auto-cached by MetadataStore). With custom identifier: Returns cached metadata from the store.
Examples:
// New metadata
$m = metadata()->title('Username')->description('User login identifier');
// From class attributes (auto-built and cached)
$userMeta = metadata(User::class);
// Access property metadata
$usernameMeta = metadata(User::class)->username;
// Manually store metadata
Mini::$mini->get(MetadataStore::class)[User::class] = metadata()
->title('User')
->properties([
'username' => metadata()->title('Username')->readOnly(true)
]);
Signature
function metadata(?string $classOrName = NULL): mini\Metadata\Metadata
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$classOrName |
?string |
NULL
|
Documentation missing |