PHP code example of olegf13 / yii2-mongorevision-behavior

1. Go to this page and download the library: Download olegf13/yii2-mongorevision-behavior 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/ */

    

olegf13 / yii2-mongorevision-behavior example snippets


use olegf13\mongorevision\MongoRevisionBehavior;
// ...
public function behaviors()
{
    return [
        MongoRevisionBehavior::className(),
    ];
}

use olegf13\mongorevision\MongoRevisionBehavior;
// ...
public function behaviors()
{
    return [
        [
            'class' => MongoRevisionBehavior::className(),
            'mongoConnectionName' => 'mongodb',
            'mongoCollection' => 'revision',
            'revisionOwnerIdAttribute' => 'ownerId',
            'revisionOwnerModelAttribute' => 'ownerModel',
            'revisionDateAttribute' => 'revisionDate',
            'revisionUserAttribute' => 'revisionUser',
        ],
    ];
}

php composer.phar