Don't serialize protected attrs
This commit is contained in:
parent
3fd6b9d474
commit
73f4762a55
@ -2407,4 +2407,22 @@ class Notice extends Memcached_DataObject
|
||||
}
|
||||
return $this->_original;
|
||||
}
|
||||
|
||||
/**
|
||||
* Magic function called at serialize() time.
|
||||
*
|
||||
* We use this to drop a couple process-specific references
|
||||
* from DB_DataObject which can cause trouble in future
|
||||
* processes.
|
||||
*
|
||||
* @return array of variable names to include in serialization.
|
||||
*/
|
||||
|
||||
function __sleep()
|
||||
{
|
||||
$vars = parent::__sleep();
|
||||
$skip = array('_original', '_profile');
|
||||
return array_diff($vars, $skip);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1353,4 +1353,21 @@ class Profile extends Memcached_DataObject
|
||||
}
|
||||
return $profile;
|
||||
}
|
||||
|
||||
/**
|
||||
* Magic function called at serialize() time.
|
||||
*
|
||||
* We use this to drop a couple process-specific references
|
||||
* from DB_DataObject which can cause trouble in future
|
||||
* processes.
|
||||
*
|
||||
* @return array of variable names to include in serialization.
|
||||
*/
|
||||
|
||||
function __sleep()
|
||||
{
|
||||
$vars = parent::__sleep();
|
||||
$skip = array('_user');
|
||||
return array_diff($vars, $skip);
|
||||
}
|
||||
}
|
||||
|
@ -983,4 +983,21 @@ class User extends Memcached_DataObject
|
||||
|
||||
return $apps;
|
||||
}
|
||||
|
||||
/**
|
||||
* Magic function called at serialize() time.
|
||||
*
|
||||
* We use this to drop a couple process-specific references
|
||||
* from DB_DataObject which can cause trouble in future
|
||||
* processes.
|
||||
*
|
||||
* @return array of variable names to include in serialization.
|
||||
*/
|
||||
|
||||
function __sleep()
|
||||
{
|
||||
$vars = parent::__sleep();
|
||||
$skip = array('_profile');
|
||||
return array_diff($vars, $skip);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user