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,122 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
Age: 55
All time rank: 19476 in Latvia Latvia
Week rank: 51 Up1 in Latvia Latvia Up
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

  Files folder image Files (39)  /  actions  
File Role Description
  Plain text file D3EditableAction.php Class Class source
  Plain text file D3IndexAction.php Class Class source

  Files folder image Files (39)  /  components  
File Role Description
  Plain text file ActivityRecord.php Class Class source
  Plain text file ActivityRegistar.php Class Class source
  Plain text file D3ActivityList.php Class Class source
  Plain text file DbActivityRegistar.php Class Class source
  Plain text file DummyActivityRegistar.php Class Class source
  Plain text file ModelActivityInterface.php Class Class source

  Files folder image Files (39)  /  dictionaries  
File Role Description
  Plain text file D3aActionDictionary.php Class Class source
  Plain text file D3aActionLabelDictionary.php Class Class source

  Files folder image Files (39)  /  doc  
File Role Description
  Accessible without login Image file DB.png Data Auxiliary data
  Accessible without login Plain text file db_schema.schemaxml Data Auxiliary data

  Files folder image Files (39)  /  gii  
File Role Description
  Accessible without login Plain text file D3ActivityGiiantNModule.json Data Auxiliary data
  Accessible without login Plain text file d3a_actionGiiantModel.json Data Auxiliary data
  Accessible without login Plain text file d3a_activityGiiantModel.json Data Auxiliary data

  Files folder image Files (39)  /  logic  
File Role Description
  Plain text file BrowserDataHelper.php Class Class source
  Plain text file RegActivity.php Class Class source

  Files folder image Files (39)  /  messages  
File Role Description
Files folder imagelv (1 file)

  Files folder image Files (39)  /  messages  /  lv  
File Role Description
  Accessible without login Plain text file d3activity.php Aux. Auxiliary script

  Files folder image Files (39)  /  migrations  
File Role Description
  Plain text file m210309_140707_init.php Class Class source
  Plain text file m210329_173818_cha...ActivityDataCol.php Class Class source
  Plain text file m210408_215836_createD3DactionLabel.php Class Class source
  Plain text file m210408_223207_fillD3DActionLabel.php Class Class source
  Plain text file m210413_090707_act...panyIdcanbeNull.php Class Class source
  Plain text file m211202_121335_d3y...ion_name_to_256.php Class Class source

  Files folder image Files (39)  /  models  
File Role Description
Files folder imagebase (3 files)
  Plain text file D3aAction.php Class Class source
  Plain text file D3aActivity.php Class Class source
  Plain text file D3aActivityQuery.php Class Class source
  Plain text file D3DActionLabel.php Class Class source
  Plain text file SysModels.php Class Class source

  Files folder image Files (39)  /  models  /  base  
File Role Description
  Plain text file D3aAction.php Class Class source
  Plain text file D3aActivity.php Class Class source
  Plain text file D3DActionLabel.php Class Class source

  Files folder image Files (39)  /  tests  
File Role Description
Files folder imagecomponents (3 files)

  Files folder image Files (39)  /  tests  /  components  
File Role Description
  Plain text file D3ActivityListTest.php Class Class source
  Plain text file TestModel.php Class Class source
  Plain text file TestModelD3Activity.php Class Class source

  Files folder image Files (39)  /  views  
File Role Description
Files folder imageactions (1 file)

  Files folder image Files (39)  /  views  /  actions  
File Role Description
  Accessible without login Plain text file index.php Example Example script

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,122
This week:455Up