mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-01 00:03:18 +01:00
- 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:
parent
0e84f7d284
commit
ff1a020630
1 changed files with 5 additions and 2 deletions
|
@ -1036,15 +1036,18 @@ class LSldapObject {
|
||||||
function updateRelationsCache() {
|
function updateRelationsCache() {
|
||||||
$this -> _relationsCache=array();
|
$this -> _relationsCache=array();
|
||||||
if (is_array($this->config['relations'])) {
|
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) {
|
foreach($this->config['relations'] as $relation_name => $relation_conf) {
|
||||||
if ( isset($relation_conf['list_function']) ) {
|
if ( isset($relation_conf['list_function']) ) {
|
||||||
if ($GLOBALS['LSsession'] -> loadLSobject($relation_conf['LSobject'])) {
|
if ($GLOBALS['LSsession'] -> loadLSobject($relation_conf['LSobject'])) {
|
||||||
$obj = new $relation_conf['LSobject']();
|
$obj = new $relation_conf['LSobject']();
|
||||||
if ((method_exists($obj,$relation_conf['list_function']))&&(method_exists($obj,$relation_conf['getkeyvalue_function']))) {
|
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)) {
|
if (is_array($list)) {
|
||||||
// Key Value
|
// Key Value
|
||||||
$key = $obj -> $relation_conf['getkeyvalue_function']($this);
|
$key = $obj -> $relation_conf['getkeyvalue_function']($me);
|
||||||
|
|
||||||
$this -> _relationsCache[$relation_name] = array(
|
$this -> _relationsCache[$relation_name] = array(
|
||||||
'list' => $list,
|
'list' => $list,
|
||||||
|
|
Loading…
Reference in a new issue