/** * @param $entity * @param $filePathField * @param bool $absolute * * @return string * @throws \Exception */ public function bigfootFile($entity, $filePathField, $absolute = false) { if ($absolute === true) { return $this->fileManager->getFileAbsolutePath($entity, $filePathField); } else { return $this->fileManager->getFilePath($entity, $filePathField); } }
/** * @param LifecycleEventArgs $args */ private function upload(LifecycleEventArgs $args) { $entity = $args->getEntity(); $bigfootFileFields = $this->getBigfootFileFields($entity); foreach ($bigfootFileFields as $bigfootFileField) { $this->fileManager->upload($entity, $bigfootFileField['filePathProperty'], $bigfootFileField['fileFieldProperty']); } }