本文整理汇总了PHP中Country::remember方法的典型用法代码示例。如果您正苦于以下问题:PHP Country::remember方法的具体用法?PHP Country::remember怎么用?PHP Country::remember使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Country
的用法示例。
在下文中一共展示了Country::remember方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getViewModel
private static function getViewModel()
{
return ['countries' => Country::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'industries' => Industry::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get()];
}
示例2: getViewModel
private static function getViewModel()
{
return ['account' => Auth::user()->account, 'branches' => Branch::where('account_id', '=', Auth::user()->account_id)->where('id', Auth::user()->branch_id)->orderBy('public_id')->get(), 'products' => Product::scope()->orderBy('id')->get(array('product_key', 'notes', 'cost', 'qty')), 'countries' => Country::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'clients' => Client::scope()->with('contacts', 'country')->orderBy('name')->get(), 'taxRates' => TaxRate::scope()->orderBy('name')->get(), 'currencies' => Currency::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'sizes' => Size::remember(DEFAULT_QUERY_CACHE)->orderBy('id')->get(), 'paymentTerms' => PaymentTerm::remember(DEFAULT_QUERY_CACHE)->orderBy('num_days')->get(['name', 'num_days']), 'industries' => Industry::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'frequencies' => array(1 => 'Semanal', 2 => 'Cada 2 semanas', 3 => 'Cada 4 semanas', 4 => 'Mensual', 5 => 'Trimestral', 6 => 'Semestral', 7 => 'Anual')];
}
示例3: show_license_payment
public function show_license_payment()
{
if (Input::has('return_url')) {
Session::set('return_url', Input::get('return_url'));
}
if (Input::has('affiliate_key')) {
if ($affiliate = Affiliate::where('affiliate_key', '=', Input::get('affiliate_key'))->first()) {
Session::set('affiliate_id', $affiliate->id);
}
}
if (!Session::get('affiliate_id')) {
return Utils::fatalError();
}
if (Input::has('test_mode')) {
Session::set('test_mode', Input::get('test_mode'));
}
$account = $this->accountRepo->getNinjaAccount();
$account->load('account_gateways.gateway');
$accountGateway = $account->account_gateways[0];
$gateway = $accountGateway->gateway;
$paymentLibrary = $gateway->paymentlibrary;
$acceptedCreditCardTypes = $accountGateway->getCreditcardTypes();
$affiliate = Affiliate::find(Session::get('affiliate_id'));
$data = ['showBreadcrumbs' => false, 'hideHeader' => true, 'url' => 'license', 'amount' => LICENSE_PRICE, 'client' => false, 'contact' => false, 'paymentLibrary' => $paymentLibrary, 'gateway' => $gateway, 'acceptedCreditCardTypes' => $acceptedCreditCardTypes, 'countries' => Country::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'currencyId' => 1, 'paymentTitle' => $affiliate->payment_title, 'paymentSubtitle' => $affiliate->payment_subtitle];
return View::make('payments.payment', $data);
}
示例4: getViewModel
private static function getViewModel()
{
return ['entityType' => ENTITY_QUOTE, 'account' => Auth::user()->account, 'products' => Product::scope()->orderBy('id')->get(array('product_key', 'notes', 'cost', 'qty')), 'countries' => Country::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'clients' => Client::scope()->with('contacts', 'country')->orderBy('name')->get(), 'taxRates' => TaxRate::scope()->orderBy('name')->get(), 'currencies' => Currency::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'sizes' => Size::remember(DEFAULT_QUERY_CACHE)->orderBy('id')->get(), 'industries' => Industry::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'invoiceDesigns' => InvoiceDesign::remember(DEFAULT_QUERY_CACHE)->orderBy('id')->get(), 'invoiceLabels' => Auth::user()->account->getInvoiceLabels()];
}
示例5: importFile
private function importFile()
{
$data = Session::get('data');
Session::forget('data');
$map = Input::get('map');
$count = 0;
$hasHeaders = Input::get('header_checkbox');
$countries = Country::remember(DEFAULT_QUERY_CACHE)->get();
$countryMap = [];
foreach ($countries as $country) {
$countryMap[strtolower($country->name)] = $country->id;
}
foreach ($data as $row) {
if ($hasHeaders) {
$hasHeaders = false;
continue;
}
$client = Client::createNew();
$contact = Contact::createNew();
$contact->is_primary = true;
$contact->send_invoice = true;
$count++;
foreach ($row as $index => $value) {
$field = $map[$index];
$value = trim($value);
if ($field == Client::$fieldVat_number && !$client->vat_number) {
$client->vat_number = $value;
} else {
if ($field == Client::$fieldName && !$client->name) {
$client->name = $value;
} else {
if ($field == Client::$fieldNit && !$client->nit) {
$client->nit = $value;
} else {
if ($field == Client::$fieldPhone && !$client->work_phone) {
$client->work_phone = $value;
} else {
if ($field == Client::$fieldAddress1 && !$client->address1) {
$client->address1 = $value;
} else {
if ($field == Client::$fieldAddress2 && !$client->address2) {
$client->address2 = $value;
} else {
if ($field == Client::$fieldNotes && !$client->private_notes) {
$client->private_notes = $value;
} else {
if ($field == Contact::$fieldFirstName && !$contact->first_name) {
$contact->first_name = $value;
} else {
if ($field == Contact::$fieldLastName && !$contact->last_name) {
$contact->last_name = $value;
} else {
if ($field == Contact::$fieldPhone && !$contact->phone) {
$contact->phone = $value;
} else {
if ($field == Contact::$fieldEmail && !$contact->email) {
$contact->email = strtolower($value);
}
}
}
}
}
}
}
}
}
}
}
}
$client->save();
$client->contacts()->save($contact);
$client->save();
Activity::createClient($client, false);
}
$message = Utils::pluralize('created_client', $count);
Session::flash('message', $message);
return Redirect::to('clients');
}
示例6: getViewModel
private static function getViewModel()
{
return ['sizes' => Size::remember(DEFAULT_QUERY_CACHE)->orderBy('id')->get(), 'paymentTerms' => PaymentTerm::remember(DEFAULT_QUERY_CACHE)->orderBy('num_days')->get(['name', 'num_days']), 'industries' => Industry::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'currencies' => Currency::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'countries' => Country::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'customLabel1' => Auth::user()->account->custom_client_label1, 'customLabel2' => Auth::user()->account->custom_client_label2];
}
示例7: getViewModel
private static function getViewModel()
{
$recurringHelp = '';
foreach (preg_split("/((\r?\n)|(\r\n?))/", trans('texts.recurring_help')) as $line) {
$parts = explode("=>", $line);
if (count($parts) > 1) {
$line = $parts[0] . ' => ' . Utils::processVariables($parts[0]);
$recurringHelp .= '<li>' . strip_tags($line) . '</li>';
} else {
$recurringHelp .= $line;
}
}
return ['account' => Auth::user()->account, 'products' => Product::scope()->orderBy('id')->get(array('product_key', 'notes', 'cost', 'qty')), 'countries' => Country::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'clients' => Client::scope()->with('contacts', 'country')->orderBy('name')->get(), 'taxRates' => TaxRate::scope()->orderBy('name')->get(), 'currencies' => Currency::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'sizes' => Size::remember(DEFAULT_QUERY_CACHE)->orderBy('id')->get(), 'paymentTerms' => PaymentTerm::remember(DEFAULT_QUERY_CACHE)->orderBy('num_days')->get(['name', 'num_days']), 'industries' => Industry::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'invoiceDesigns' => InvoiceDesign::remember(DEFAULT_QUERY_CACHE, 'invoice_designs_cache_' . Auth::user()->maxInvoiceDesignId())->where('id', '<=', Auth::user()->maxInvoiceDesignId())->orderBy('id')->get(), 'frequencies' => array(1 => 'Weekly', 2 => 'Two weeks', 3 => 'Four weeks', 4 => 'Monthly', 5 => 'Three months', 6 => 'Six months', 7 => 'Annually'), 'recurringHelp' => $recurringHelp];
}
示例8: getViewModel
private static function getViewModel()
{
return ['account' => Auth::user()->account, 'branch' => Auth::user()->branch, 'products' => Product::scope()->with('prices')->orderBy('id')->get(), 'countries' => Country::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'taxRates' => TaxRate::scope()->orderBy('name')->get(), 'currencies' => Currency::orderBy('name')->get(), 'industries' => Industry::remember(DEFAULT_QUERY_CACHE)->orderBy('id')->get(), 'invoiceDesigns' => InvoiceDesign::remember(DEFAULT_QUERY_CACHE)->orderBy('id')->get(), 'invoiceLabels' => Auth::user()->account->getInvoiceLabels(), 'frequencies' => array(1 => 'Semanal', 2 => 'Cada 2 semanas', 3 => 'Cada 4 semanas', 4 => 'Mensual', 5 => 'Trimestral', 6 => 'Semestral', 7 => 'Anual')];
}
示例9: getViewModel
private static function getViewModel()
{
return ['account' => Auth::user()->account, 'products' => Product::scope()->orderBy('id')->get(array('product_key', 'notes', 'cost', 'qty')), 'countries' => Country::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'clients' => Client::scope()->with('contacts', 'country')->orderBy('name')->get(), 'taxRates' => TaxRate::scope()->orderBy('name')->get(), 'currencies' => Currency::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'sizes' => Size::remember(DEFAULT_QUERY_CACHE)->orderBy('id')->get(), 'paymentTerms' => PaymentTerm::remember(DEFAULT_QUERY_CACHE)->orderBy('num_days')->get(['name', 'num_days']), 'industries' => Industry::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'invoiceDesigns' => InvoiceDesign::remember(DEFAULT_QUERY_CACHE)->orderBy('id')->get(), 'invoiceLabels' => Auth::user()->account->getInvoiceLabels(), 'frequencies' => array(1 => 'Weekly', 2 => 'Two weeks', 3 => 'Four weeks', 4 => 'Monthly', 5 => 'Three months', 6 => 'Six months', 7 => 'Annually')];
}
示例10: getViewModel
private static function getViewModel()
{
return ['industries' => Industry::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'business_types' => BusinessType::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'groups' => Group::orderBy('name')->get(), 'zones' => Zone::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'currencies' => Currency::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'countries' => Country::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'customLabel1' => Auth::user()->account->custom_client_label1, 'customLabel2' => Auth::user()->account->custom_client_label2];
}