mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
if parent in collection replace with child, problem, sibling isn't added
This commit is contained in:
parent
68671e297c
commit
a78c62789c
@ -231,6 +231,18 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
|
|||||||
public function addSocialAction(SocialAction $socialAction): self
|
public function addSocialAction(SocialAction $socialAction): self
|
||||||
{
|
{
|
||||||
$descendants = $socialAction->getDescendantsWithThis();
|
$descendants = $socialAction->getDescendantsWithThis();
|
||||||
|
$parent = $socialAction->getParent();
|
||||||
|
|
||||||
|
dump($this->socialActions);
|
||||||
|
dump($parent);
|
||||||
|
|
||||||
|
$parentKey = array_search($parent, $this->socialActions->toArray());
|
||||||
|
|
||||||
|
if (null !== $parentKey) {
|
||||||
|
dump(true);
|
||||||
|
$this->socialActions[$parentKey] = $socialAction;
|
||||||
|
// return $this;
|
||||||
|
}
|
||||||
|
|
||||||
if (count($descendants) > 0) {
|
if (count($descendants) > 0) {
|
||||||
foreach ($descendants as $d) {
|
foreach ($descendants as $d) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user