2017 © Pedro Peláez
 

library entity-change-log-behavior

Yii2 Behavior. Logger for entity changes

image

shamanzpua/entity-change-log-behavior

Yii2 Behavior. Logger for entity changes

  • Wednesday, April 12, 2017
  • by shamanzpua
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1,224 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 1 % Grown

The README.md

Entity chane logger behavior

Logs models state before and after change, (*1)

Installation

Add to composer.json, (*2)

 "require": {
    "shamanzpua/entity-change-log-behavior": "*"
 }

Usage:

 public function behaviors()
  {
      return [
          [
              'class' => EntityChangeLogBehavior::class,

              'logModelClass' => Log::class,  //ActiveRecord log table class

              'attributes' => [   //attributes of owner. Default: all attributes
                  'name',
                  'date',
                  'id',
              ],

              'columns' => [  //Required log table columns
                  'action' => 'action_column_name' // Default 'action',
                  'new_value' => 'new_value_column_name' // Default 'new_value',
                  'old_value' => 'old_value_column_name' // Default 'old_value',
              ],

              'relatedAttributes' => [   //attributes of owners relations
                  'user' => ['email'],
                  'category' => ['name'],
              ],

              'additionalLogTableFields' => [   //additional log table fields. key -> log table col, value -> owners col
                  'log_item_name' => 'title',
              ],
          ]
      ];
  }

The Versions

12/04 2017

dev-master

9999999-dev

Yii2 Behavior. Logger for entity changes

  Sources   Download

The Requires

 

by shamanzp

php yii2 behavior change

12/04 2017

1.0.3

1.0.3.0

Yii2 Behavior. Logger for entity changes

  Sources   Download

The Requires

 

by shamanzp

php yii2 behavior change

12/04 2017

1.0.2

1.0.2.0

Yii2 Behavior. Logger for entity changes

  Sources   Download

The Requires

 

by shamanzp

php yii2 behavior change

12/04 2017

1.0.1

1.0.1.0

Yii2 Behavior. Logger for entity changes

  Sources   Download

The Requires

 

by shamanzp

php yii2 behavior change

12/04 2017

1.0

1.0.0.0

Yii2 Behavior. Logger for entity changes

  Sources   Download

The Requires

 

by shamanzp

php yii2 behavior change