club = $club; } public function setContent(string $title, string $description) { $this->club->title = $title; $this->club->description = $description; } public function setBannerUpload(?Upload $upload = null) { if( $upload ){ $upload->requireImage(); if( $upload->isValid() ){ $path = 'data://club_banners/' . $this->club->club_id . '.jpg'; if(File::copyFileToAbstractedPath($upload->getFileWrapper()->getFilePath(), $path)){ $this->club->banner_date = \XF::$time; } } } } protected function syncForumNode() { if( $this->club->Forum && $this->club->Forum->Node ) { $node = $this->club->Forum->Node; $node->title = $this->club->title; $node->description = $this->club->description; $node->save(); } } protected function _validate() { $this->club->preSave(); return $this->club->getErrors(); } protected function _save() { $this->club->save(); $this->syncForumNode(); return $this->club; } }