PHP code example of vsevolod-ryzhov / yii2-ar-logger

1. Go to this page and download the library: Download vsevolod-ryzhov/yii2-ar-logger 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/ */

    

vsevolod-ryzhov / yii2-ar-logger example snippets


public function behaviors()
{
    return [
        ...
        [
            'class' => ArLoggerBehavior::class,
            'excludedAttributes' => ['created_at', 'updated_at'],
        ],
        ...
    ];
}

// create your own storage class
class MyOwnStorage implements ArLoggerStorageInterface
{
    public function store(ArLoggerObject $object): bool
    {
        // save $object here
        return true;
    }
}

// pass storage class to behavior param "storage"
public function behaviors()
{
    return [
        ...
        [
            'class' => ArLoggerBehavior::class,
            'storage' => MyOwnStorage::class,
            'excludedAttributes' => ['created_at', 'updated_at'],
        ],
        ...
    ];
}

php yii migrate --migrationPath=@vendor/vsevolod-ryzhov/yii2-ar-logger/src/migrations