- LSldapObject :: updateRelationsCache()

-> Utilisation d'un nouvel objet pour faire le cache plutot que $this. Cela
		 posait des problèmes dans la mise à jour de relation sinon
This commit is contained in:
Benjamin Renard 2008-10-09 10:19:07 +00:00
parent 0e84f7d284
commit ff1a020630

View file

@ -1036,15 +1036,18 @@ class LSldapObject {
function updateRelationsCache() {
$this -> _relationsCache=array();
if (is_array($this->config['relations'])) {
$type = $this -> getType();
$me = new $type();
$me -> loadData($this -> getDn());
foreach($this->config['relations'] as $relation_name => $relation_conf) {
if ( isset($relation_conf['list_function']) ) {
if ($GLOBALS['LSsession'] -> loadLSobject($relation_conf['LSobject'])) {
$obj = new $relation_conf['LSobject']();
if ((method_exists($obj,$relation_conf['list_function']))&&(method_exists($obj,$relation_conf['getkeyvalue_function']))) {
$list = $obj -> $relation_conf['list_function']($this);
$list = $obj -> $relation_conf['list_function']($me);
if (is_array($list)) {
// Key Value
$key = $obj -> $relation_conf['getkeyvalue_function']($this);
$key = $obj -> $relation_conf['getkeyvalue_function']($me);
$this -> _relationsCache[$relation_name] = array(
'list' => $list,