account; $company = $entity; } else { $account = $entity->company->account; $company = $entity->company; } if (!$account->hasFeature(Account::FEATURE_DOCUMENTS)) { return false; } foreach ($document_array as $document) { $document = UploadFile::dispatchNow( $document, UploadFile::DOCUMENT, $entity->user, $entity->company, $entity ); } } }