name = $name; $this->user = $user; $this->userBox = $userBox; } public function getUserBox(): ?UserBox { return $this->userBox; } public function setUserBox(?UserBox $userBox): self { $this->userBox = $userBox; // set (or unset) the owning side of the relation if necessary $newTrashBox = $userBox === null ? null : $this; if ($newTrashBox !== $userBox->getTrashBox()) { $userBox->setTrashBox($newTrashBox); } return $this; } public function getUser(): CustomUserInterface { return $this->user; } public function setUser(?User $user): self { $this->user = $user; return $this; } // protected $tree; // protected $trashed; // // public function getTree(){ // if(isset($this->tree) && is_array($this->tree)){ // return $this->tree; // } // $this->trashedNtree(); // return $this->tree; // } // // public function isTrashed(){ // if(isset($this->trashed) && is_array($this->trashed)){ // return $this->trashed; // } // $this->trashedNtree(); // return $this->trashed; // } // // private function trashedNtree(){ // $tree = array(); // $loop = true; // $loopFolder = $this; // $trashed = null; // // while($loop){ // if($loopFolder instanceof FolderItemInterface){ // $tree[] = array( // 'guid' => $loopFolder->getGuid(), // 'name' => $loopFolder->getName() // ); // // if($loopFolder->isBase() || $loopFolder->isTrash()){ // if($loopFolder->isTrash()) // $trashed = true; // // $loopFolder = null; // } // else // $loopFolder = $loopFolder->getParent(); // // } else { // $loop = false; // } // } // // $this->tree = array_reverse($tree); // // if(!is_null($trashed) && $trashed = true) // $this->trashed = true; // else // $this->trashed = false; // } }