PHP Classes

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

Recommend this page to a friend!
  Info   View files Documentation   View files View files (39)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2022-01-08 (13 days ago) RSS 2.0 feedNot yet rated by the usersTotal: 22 This week: 1All time: 10,464 This week: 187Up
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: 17 packages by
Country: Latvia Latvia
Innovation award
Innovation award
Nominee: 11x

Winner: 2x

 

Details

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  
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

 Version Control Unique User Downloads Download Rankings  
 100%
Total:22
This week:1
All time:10,464
This week:187Up

For more information send a message to info at phpclasses dot org.