5. Developer Extension API
Implementing the Interface
use Momocode\MomoAdminActivityLog\Extension\TrackableEntityProviderInterface;
use Shopware\Core\Framework\Context;
use Shopware\Core\Framework\DataAbstractionLayer\EntityWriteResult;
class MyCustomEntityProvider implements TrackableEntityProviderInterface
{
public function getEntityName(): string
{
// DAL entity name (matches the table name)
return 'my_custom_entity';
}
public function getLabel(): string
{
// Human-readable label shown in the plugin configuration
return 'My Custom Entity';
}
public function resolveDisplayName(string $entityId, EntityWriteResult $writeResult, Context $context): ?string
{
// Optional: return a human-readable display name for a log entry.
// Called when a log entry is created.
// Return null if no name can be resolved (falls back to the entity ID).
return null;
}
public function getAdminRoute(): ?string
{
// Optional: Vue Router route to the entity's detail page.
// Used for deep-links in the activity log listing.
// Format: 'sw.my.custom.entity.detail'
// Return null if no detail page exists.
return null;
}
}Registering the Service
Result
Notes
Last updated