Extension and action examples
Use the action functions with records and Data objects supplied by your application. They pass each argument to the package operation and return its result.
These adapters show container registration. Use the owning package registry when a contract requires contributor discovery.
Contract adapters wrap an existing implementation. Call their registration function from your service provider with that implementation; tagged contracts keep their declared tag. Resolve the backend by its concrete class before registration so the replacement contract does not resolve itself. Static contract metadata uses one backend class per adapter.
Action buildPublicStructuredContentItems
Section titled “Action buildPublicStructuredContentItems”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\StructuredContentLibrary;
function runBuildPublicStructuredContentItems(\Capell\StructuredContentLibrary\Enums\StructuredContentType $type, ?int $siteId = null, ?int $limit = null): array{ return \Capell\StructuredContentLibrary\Actions\BuildPublicStructuredContentItemsAction::run($type, $siteId, $limit);}Action buildStructuredContentSections
Section titled “Action buildStructuredContentSections”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\StructuredContentLibrary;
function runBuildStructuredContentSections(array $sections, ?int $siteId = null): array{ return \Capell\StructuredContentLibrary\Actions\BuildStructuredContentSectionsAction::run($sections, $siteId);}Action importStructuredContentItems
Section titled “Action importStructuredContentItems”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\StructuredContentLibrary;
function runImportStructuredContentItems(iterable $items, bool $updateExisting = true): \Capell\StructuredContentLibrary\Data\StructuredContentImportResultData{ return \Capell\StructuredContentLibrary\Actions\ImportStructuredContentItemsAction::run($items, $updateExisting);}Action listStructuredContentItems
Section titled “Action listStructuredContentItems”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\StructuredContentLibrary;
function runListStructuredContentItems(\Capell\StructuredContentLibrary\Enums\StructuredContentType $type, ?int $siteId = null, bool $publishedOnly = true): \Illuminate\Support\Collection{ return \Capell\StructuredContentLibrary\Actions\ListStructuredContentItemsAction::run($type, $siteId, $publishedOnly);}