當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Invitation::getLink方法代碼示例

本文整理匯總了PHP中app\models\Invitation::getLink方法的典型用法代碼示例。如果您正苦於以下問題:PHP Invitation::getLink方法的具體用法?PHP Invitation::getLink怎麽用?PHP Invitation::getLink使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在app\models\Invitation的用法示例。


在下文中一共展示了Invitation::getLink方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: transform

 public function transform(Invitation $invitation)
 {
     return ['id' => (int) $invitation->public_id, 'key' => $invitation->getName(), 'status' => $invitation->getStatus(), 'link' => $invitation->getLink(), 'sent_date' => $invitation->sent_date, 'viewed_date' => $invitation->sent_date];
 }
開發者ID:hannenijhuis,項目名稱:invoiceninja,代碼行數:4,代碼來源:InvitationTransformer.php

示例2: transform

 public function transform(Invitation $invitation)
 {
     $invitation->setRelation('account', $this->account);
     return ['id' => (int) $invitation->public_id, 'key' => $invitation->getName(), 'status' => $invitation->getStatus(), 'link' => $invitation->getLink(), 'sent_date' => $invitation->sent_date, 'viewed_date' => $invitation->sent_date];
 }
開發者ID:hillelcoren,項目名稱:invoice-ninja,代碼行數:5,代碼來源:InvitationTransformer.php

示例3: sendInvitation

 /**
  * @param Invitation $invitation
  * @param Invoice $invoice
  * @param $body
  * @param $subject
  * @param $pdfString
  * @param $documentStrings
  * @return bool|string
  * @throws \Laracasts\Presenter\Exceptions\PresenterException
  */
 private function sendInvitation(Invitation $invitation, Invoice $invoice, $body, $subject, $pdfString, $documentStrings)
 {
     $client = $invoice->client;
     $account = $invoice->account;
     if (Auth::check()) {
         $user = Auth::user();
     } else {
         $user = $invitation->user;
         if ($invitation->user->trashed()) {
             $user = $account->users()->orderBy('id')->first();
         }
     }
     if (!$user->email || !$user->registered) {
         return trans('texts.email_error_user_unregistered');
     } elseif (!$user->confirmed) {
         return trans('texts.email_error_user_unconfirmed');
     } elseif (!$invitation->contact->email) {
         return trans('texts.email_error_invalid_contact_email');
     } elseif ($invitation->contact->trashed()) {
         return trans('texts.email_error_inactive_contact');
     }
     $variables = ['account' => $account, 'client' => $client, 'invitation' => $invitation, 'amount' => $invoice->getRequestedAmount()];
     // Let the client know they'll be billed later
     if ($client->autoBillLater()) {
         $variables['autobill'] = $invoice->present()->autoBillEmailMessage();
     }
     if (empty($invitation->contact->password) && $account->hasFeature(FEATURE_CLIENT_PORTAL_PASSWORD) && $account->enable_portal_password && $account->send_portal_password) {
         // The contact needs a password
         $variables['password'] = $password = $this->generatePassword();
         $invitation->contact->password = bcrypt($password);
         $invitation->contact->save();
     }
     $data = ['body' => $this->templateService->processVariables($body, $variables), 'link' => $invitation->getLink(), 'entityType' => $invoice->getEntityType(), 'invoiceId' => $invoice->id, 'invitation' => $invitation, 'account' => $account, 'client' => $client, 'invoice' => $invoice, 'documents' => $documentStrings];
     if ($account->attachPDF()) {
         $data['pdfString'] = $pdfString;
         $data['pdfFileName'] = $invoice->getFileName();
     }
     $subject = $this->templateService->processVariables($subject, $variables);
     $fromEmail = $user->email;
     $view = $account->getTemplateView(ENTITY_INVOICE);
     $response = $this->sendTo($invitation->contact->email, $fromEmail, $account->getDisplayName(), $subject, $view, $data);
     if ($response === true) {
         return true;
     } else {
         return $response;
     }
 }
開發者ID:hillelcoren,項目名稱:invoice-ninja,代碼行數:57,代碼來源:ContactMailer.php


注:本文中的app\models\Invitation::getLink方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。