Skip to content

Latest commit

 

History

History
41 lines (27 loc) · 1.23 KB

object-descriptor.md

File metadata and controls

41 lines (27 loc) · 1.23 KB

Object Descriptor

The ObjectDescriptorInterface is the interface for components that contains logic to describe objects.

But you should be more interested in the SupportsObjectDescriptorInterface, which combined with ObjectDescriptor allow to have multiple object descriptor at once.

Example :

<?php

use Yokai\SafeDelete\Usage\Descriptor\ObjectDescriptor;
use Yokai\SafeDelete\Usage\Descriptor\SupportsObjectDescriptorInterface;

$descriptor = new ObjectDescriptor([
    new class implements SupportsObjectDescriptorInterface {/* ... */},
    new class implements SupportsObjectDescriptorInterface {/* ... */},
    /* ... */
]);

echo $descriptor->describe($object); // some string

integration this library is shipped with adapters for symfony/translation, symfony/property-access

recipe if you wish to create your own object descriptor, please follow our recipe


« README