Yii Framework Forum: Opinion: Auditoria Sin Beforesend Ni Afterfind - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Opinion: Auditoria Sin Beforesend Ni Afterfind se busca realizar auditoria de los campos actualizados Rate Topic: -----

#1 User is offline   Apositivo 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 20
  • Joined: 06-August 13

Posted 14 August 2013 - 12:53 AM

saludos, empezando con yii, que opinan del siguiente metodo ya que beforeSend() y afterFind() tiene comportamientos no deseados, se aceptan criticas y metodos super optimos para auditoria de solo campos modificados...

saludos a todos, y que tal si luego del :

public function actionUpdate($id)
	{
		
		$model=$this->loadModel($id);

if(isset($_POST['Persons']))
{
$audit="The user".Yii::app()->user->user_id." make the following updates... : ";
				foreach($model->attributes as $key => $value) 
				{
					
					if(isset($_POST['Persons'][$key]))
					{
					if($value!=$_POST['Persons'][$key])
					$audit.="[".$value. "] by . . [".$_POST['Persons'][$key]."],";
					}
				  
				}
}
if($valid)
			{
				
				
				
				
				
				
				
					if($model->save())
					{
}} . . . . 

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users