PHP code example of gollumsf / serializer-describe-attribute-bundle

1. Go to this page and download the library: Download gollumsf/serializer-describe-attribute-bundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

gollumsf / serializer-describe-attribute-bundle example snippets


return [
    // [ ... ]
    GollumSF\SerializerDescribeAttributeBundle\GollumSFSerializerDescribeAttributeBundle::class => ['all' => true],
];

use GollumSF\SerializerDescribeAttributeBundle\Attribute\SerializerDescribe;

class EntityParent {
    private $propertyA;
}

#[SerializerDescribe([
    'propertyA' => [
        'groups' => [
            'group_1', 'group_2'
        ]
    ],
    'propertyB' => [
        'serializedName' => 'new_name',
        'maxDepth' => 2
    ]
])]
class EntityChild extends EntityParent {
    private $propertyB;
}