Revert c56df8d3d and remove adding Objects directly - taking a different approach to add template actions
This commit is contained in:
parent
ac8e79ab99
commit
5ce3a63878
@ -64,8 +64,7 @@ class HomeController extends Controller
|
|||||||
->filter(fn($item)=>$item->names_lc->intersect($template->attributes->map('strtolower'))->count())
|
->filter(fn($item)=>$item->names_lc->intersect($template->attributes->map('strtolower'))->count())
|
||||||
->sortBy(fn($item)=>Arr::get($template->order,$item->name)) as $ao)
|
->sortBy(fn($item)=>Arr::get($template->order,$item->name)) as $ao)
|
||||||
{
|
{
|
||||||
$o->addObjectItem($ao->name,
|
$o->{$ao->name} = [Entry::TAG_NOTAG=>''];
|
||||||
Factory::create(dn: '',attribute: $ao->name,values: [Entry::TAG_NOTAG=>''],oc: $o->objectclass));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,7 +130,7 @@ class Entry extends Model
|
|||||||
$o = $this->objects->get($attribute) ?: Factory::create($this->dn ?: '',$attribute,[],Arr::get($this->attributes,'objectclass',[]));
|
$o = $this->objects->get($attribute) ?: Factory::create($this->dn ?: '',$attribute,[],Arr::get($this->attributes,'objectclass',[]));
|
||||||
$o->values = collect($value);
|
$o->values = collect($value);
|
||||||
|
|
||||||
$this->addObjectItem($key,$o);
|
$this->objects->put($key,$o);
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
@ -211,19 +211,7 @@ class Entry extends Model
|
|||||||
$o = $this->objects->get($attribute) ?: Attribute\Factory::create($this->dn ?: '',$attribute,[]);
|
$o = $this->objects->get($attribute) ?: Attribute\Factory::create($this->dn ?: '',$attribute,[]);
|
||||||
$o->addValue($tag,[$value]);
|
$o->addValue($tag,[$value]);
|
||||||
|
|
||||||
$this->addObjectItem($attribute,$o);
|
$this->objects->put($key,$o);
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add a new object item directly
|
|
||||||
*
|
|
||||||
* @param string $name
|
|
||||||
* @param Attribute $o
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function addObjectItem(string $name,Attribute $o): void
|
|
||||||
{
|
|
||||||
$this->objects->put($name,$o);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user