Welcome Guest, Not a member yet? Register   Sign In
log action model & entity
#4

Before updating, check the changed properties of the entity and save somewhere (log, other table)

PHP Code:
<?php

// Controller, Something like this
$entity $model->get(15);
$entity->setText('new text');

if (
$entity->hasChanged('text')) {
    // save to log, table
}

$model->update($entity'id'); 
Simple CI 4 project for beginners codeigniter-expenses ( topic )
Reply


Messages In This Thread
log action model & entity - by devo - 09-09-2023, 02:29 AM
RE: log action model & entity - by ozornick - 09-09-2023, 10:00 AM
RE: log action model & entity - by devo - 09-09-2023, 10:41 AM
RE: log action model & entity - by ozornick - 09-09-2023, 11:28 AM
RE: log action model & entity - by InsiteFX - 09-09-2023, 09:50 PM
RE: log action model & entity - by devo - 09-14-2023, 04:14 AM



Theme © iAndrew 2016 - Forum software by © MyBB