PHP code example of jeyroik / extas-repositories-fields

1. Go to this page and download the library: Download jeyroik/extas-repositories-fields 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/ */

    

jeyroik / extas-repositories-fields example snippets


class MyAdaptorPlugin extends \extas\components\repositories\FieldAdaptorPlugin
{
    protected function getMarkers()
    {
        return [
            new class () extends \extas\components\repositories\FieldAdaptor {
                public function isApplicable(string $value): bool
                {
                    // Проверяем подходит ли значение поля для адаптации.
                    return $value == 'my';
                }

                public function apply(string $value)
                {
                    return 'world';
                }
            }
        ];
    }
}