PHP Classes

D3 PHP Activity Log: Track of changes in objects of given model objects

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 30 All time: 11,160 This week: 455Up
Version License PHP version Categories
d3activity 1.0Freeware5PHP 5, Logging, Design Patterns
Description 

Author

This package can track of changes in objects of given model objects.

It can wrap around given model and model detail classes, so the changes made to the specified model class objects are recorded by this activity class.

Applications can also retrieve the activity of changes in the model class objects to allow users to examine what happened.

Picture of Uldis Nelsons
Name: Uldis Nelsons <contact>
Classes: 19 packages by
Country: Latvia Latvia
Innovation award
Innovation award
Nominee: 12x

Winner: 2x

 

Documentation

Activity registry"

Registre models activities and get activity lists

Features

Installation

The preferred way to install this extension is through composer.

Either run

$ composer require d3yii2/d3activity "*"

or add

"d3yii2/d3activity": "*"

to the require section of your composer.json file.

defining components

    'components' => [
        'activityList' => [
            'class' => 'd3yii2\d3activity\components\D3ActivityList',
            'sysCompanyId' => static function () {
                return \Yii::$app->SysCmp->getActiveCompanyId();
            },
            'models' => [
                [
                    'class' => 'd3modules\d3invoices\models\InvInvoice',
                    'detailClass' => 'd3modules\d3invoices\components\InvInvoiceD3Activity'
                ]
            ],
        ],
        'activityRegistar' => [
            'class' => 'd3yii2\d3activity\components\DbActivityRegistar',
            'sysCompanyId' => static function () {
                return \Yii::$app->SysCmp->getActiveCompanyId();
            },
            'userId' => static function () {
                return \Yii::$app->user->id;
            }            
            
        ],
    ]

Usage

Registr eactivity

    Yii::$app
        ->activityRegistar
        ->registerModel(
            $model,
            $this->route,
            ArrayHelper::filter($deliveryModel->attributes,[
                'recipient_person'
            ])
        );

Get activity record list

        $sysModelIdA = SysModelsDictionary::getIdByClassName(TestModel::class);
        $sysModelIdB = SysModelsDictionary::getIdByClassName(self::TEST_CLASS_NAME);
        Yii::$app->activityList->filter = [ActivityConfig::PARTNER_ID => 44];
        $list = Yii::$app
            ->activityList
            ->getDescList([$sysModelIdA,$sysModelIdB]);

Examples


  Files folder image Files (39)  
File Role Description
Files folder imageactions (2 files)
Files folder imagecomponents (6 files)
Files folder imagedictionaries (2 files)
Files folder imagedoc (2 files)
Files folder imagegii (3 files)
Files folder imagelogic (2 files)
Files folder imagemessages (1 directory)
Files folder imagemigrations (6 files)
Files folder imagemodels (5 files, 1 directory)
Files folder imagetests (1 directory)
Files folder imageviews (1 directory)
Accessible without login Plain text file composer.json Data Auxiliary data
Plain text file Module.php Class Class source
Accessible without login Plain text file README.md Doc. Documentation

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:30
This week:0
All time:11,160
This week:455Up