当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Currency::getValue方法代码示例

本文整理汇总了PHP中Zend_Currency::getValue方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Currency::getValue方法的具体用法?PHP Zend_Currency::getValue怎么用?PHP Zend_Currency::getValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Currency的用法示例。


在下文中一共展示了Zend_Currency::getValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: summaryDialogAction

 /**
  * Displays the reference summary details page as a popup.
  */
 public function summaryDialogAction()
 {
     $this->_helper->getHelper('layout')->disableLayout();
     $session = new Zend_Session_Namespace('referencing_global');
     $referenceManager = new Manager_Referencing_Reference();
     $reference = $referenceManager->getReference($session->referenceId);
     //Prepare the prospective landlord details.
     $prospectiveLandlord = $reference->propertyLease->prospectiveLandlord;
     $pllArray = array();
     $pllArray['name'] = $prospectiveLandlord->name->firstName . ' ' . $prospectiveLandlord->name->lastName;
     $pllArray['contactName'] = '';
     $pllArray['address'] = $prospectiveLandlord->address->addressLine1 . ' ' . $prospectiveLandlord->address->addressLine2 . ' ' . $prospectiveLandlord->address->town;
     $pllArray['postCode'] = $prospectiveLandlord->address->postCode;
     $pllArray['telephone'] = $prospectiveLandlord->contactDetails->telephone1;
     $pllArray['mobile'] = $prospectiveLandlord->contactDetails->telephone2;
     $pllArray['email'] = $prospectiveLandlord->contactDetails->email1;
     $this->view->prospectiveLandlord = $pllArray;
     //Prepare the property details.
     $propertyArray = array();
     $propertyArray['address'] = $reference->propertyLease->address->addressLine1 . ' ' . $reference->propertyLease->address->addressLine2 . ' ' . $reference->propertyLease->address->town;
     $propertyArray['postCode'] = $reference->propertyLease->address->postCode;
     $propertyArray['rent'] = $reference->propertyLease->rentPerMonth->getValue();
     $propertyArray['startDate'] = $reference->propertyLease->tenancyStartDate->toString();
     $propertyArray['duration'] = $reference->propertyLease->tenancyTerm;
     $propertyArray['noOfTenants'] = $reference->propertyLease->noOfTenants;
     $this->view->property = $propertyArray;
     //Prepare the reference subject details
     $referenceSubject = $reference->referenceSubject;
     $referenceSubjectArray = array();
     $referenceSubjectArray['name'] = $referenceSubject->name->firstName . ' ' . $referenceSubject->name->lastName;
     $referenceSubjectArray['maidenName'] = $referenceSubject->name->maidenName;
     $referenceSubjectArray['dob'] = $referenceSubject->dob->toString();
     if (!empty($referenceSubject->bankAccount)) {
         $referenceSubjectArray['bankAccountNumber'] = $referenceSubject->bankAccount->accountNumber;
         $referenceSubjectArray['bankSortCode'] = $referenceSubject->bankAccount->sortCode;
     } else {
         $referenceSubjectArray['bankAccountNumber'] = '';
         $referenceSubjectArray['bankSortCode'] = '';
     }
     $referenceSubjectArray['telephone'] = $referenceSubject->contactDetails->telephone1;
     $referenceSubjectArray['mobile'] = $referenceSubject->contactDetails->telephone2;
     $referenceSubjectArray['email'] = $referenceSubject->contactDetails->email1;
     $residenceManager = new Manager_Referencing_Residence();
     $residence = $residenceManager->findSpecificResidence($reference->referenceSubject->residences, Model_Referencing_ResidenceChronology::CURRENT);
     $referenceSubjectArray['currentResidentialStatus'] = Model_Referencing_ResidenceStatus::toString($residence->status);
     $occupationManager = new Manager_Referencing_Occupation();
     $occupation = $occupationManager->findSpecificOccupation($reference->referenceSubject->occupations, Model_Referencing_OccupationChronology::CURRENT, Model_Referencing_OccupationImportance::FIRST);
     //Convert the occupation type to an 'occupation status' for display purposes.
     switch ($occupation->type) {
         case Model_Referencing_OccupationTypes::EMPLOYMENT:
             $occupationStatus = 'Employed';
             break;
         case Model_Referencing_OccupationTypes::CONTRACT:
             $occupationStatus = 'On Contract';
             break;
         case Model_Referencing_OccupationTypes::SELFEMPLOYMENT:
             $occupationStatus = 'Self Employed';
             break;
         case Model_Referencing_OccupationTypes::INDEPENDENT:
             $occupationStatus = 'Financially Independent';
             break;
         case Model_Referencing_OccupationTypes::RETIREMENT:
             $occupationStatus = 'Retired';
             break;
         case Model_Referencing_OccupationTypes::STUDENT:
             $occupationStatus = 'Student';
             break;
         case Model_Referencing_OccupationTypes::UNEMPLOYMENT:
             $occupationStatus = 'Unemployed';
             break;
         case Model_Referencing_OccupationTypes::OTHER:
             $occupationStatus = 'Other';
             break;
         default:
             throw new Zend_Exception(get_class() . '::' . __FUNCTION__ . ': unknonwn type provided.');
     }
     $referenceSubjectArray['currentOccupationStatus'] = $occupationStatus;
     $referenceSubjectArray['isOccupationLikelyToChange'] = $occupation->isPermanent ? 'No' : 'Yes';
     //Calculate the total income.
     $totalIncome = new Zend_Currency(array('value' => 0, 'precision' => 0));
     foreach ($reference->referenceSubject->occupations as $occupation) {
         $totalIncome->add($occupation->income);
     }
     $referenceSubjectArray['income'] = $totalIncome->getValue();
     $referenceSubjectArray['shareOfRent'] = $referenceSubject->shareOfRent->getValue();
     $this->view->referenceSubject = $referenceSubjectArray;
     //Prepare the current landlord details.
     $currentResidence = $residenceManager->findSpecificResidence($reference->referenceSubject->residences, Model_Referencing_ResidenceChronology::CURRENT);
     $currentLandlordArray = array();
     if (!empty($currentResidence->refereeDetails)) {
         $currentLandlordArray['name'] = $currentResidence->refereeDetails->name->firstName . ' ' . $currentResidence->refereeDetails->name->lastName;
         $currentLandlordArray['address'] = $currentResidence->refereeDetails->address->addressLine1 . ' ' . $currentResidence->refereeDetails->address->addressLine2 . ' ' . $currentResidence->refereeDetails->address->town;
         $currentLandlordArray['postCode'] = $currentResidence->refereeDetails->address->postCode;
         $currentLandlordArray['telephoneDay'] = $currentResidence->refereeDetails->contactDetails->telephone1;
         $currentLandlordArray['telephoneEvening'] = $currentResidence->refereeDetails->contactDetails->telephone2;
         $currentLandlordArray['fax'] = $currentResidence->refereeDetails->contactDetails->fax1;
         $currentLandlordArray['email'] = $currentResidence->refereeDetails->contactDetails->email1;
//.........这里部分代码省略.........
开发者ID:AlexEvesDeveloper,项目名称:hl-stuff,代码行数:101,代码来源:IndexController.php

示例2: testSetValueWithoutLocale

 /**
  * @ZF-9519
  */
 public function testSetValueWithoutLocale()
 {
     $currency = new Zend_Currency('RUB', 'ru_RU');
     require_once 'Currency/ExchangeTest.php';
     $this->assertEquals(null, $currency->getService());
     $currency->setService(new ExchangeTest());
     $this->assertTrue($currency->getService() instanceof Zend_Currency_CurrencyInterface);
     $currency->setValue(100, 'USD');
     $this->assertEquals(50, $currency->getValue());
     $this->assertEquals('RUB', $currency->getShortName());
 }
开发者ID:ThorstenSuckow,项目名称:conjoon,代码行数:14,代码来源:CurrencyTest.php

示例3: insertReferenceSubject

 public function insertReferenceSubject($referenceSubject)
 {
     //Get the bank account details.
     if (!empty($referenceSubject->bankAccount)) {
         $accountNumber = $referenceSubject->bankAccount->accountNumber;
         $sortCode = $referenceSubject->bankAccount->sortCode;
         if ($referenceSubject->bankAccount->isValidated) {
             $isValidated = 'Yes';
         } else {
             $isValidated = 'No';
         }
     } else {
         $accountNumber = '';
         $sortCode = '';
         $isValidated = 'N/A';
     }
     //Get the current residential status.
     if (!empty($referenceSubject->residences)) {
         foreach ($referenceSubject->residences as $residence) {
             if ($residence->chronology == Model_Referencing_ResidenceChronology::CURRENT) {
                 switch ($residence->status) {
                     case Model_Referencing_ResidenceStatus::OWNER:
                         $currentResidentialStatus = 'Owner';
                         break;
                     case Model_Referencing_ResidenceStatus::TENANT:
                         $currentResidentialStatus = 'Tenant';
                         break;
                     case Model_Referencing_ResidenceStatus::LIVING_WITH_RELATIVES:
                         $currentResidentialStatus = 'Living with Relative';
                         break;
                 }
                 break;
             }
         }
     }
     //Get the occupational income.
     $totalIncome = new Zend_Currency(array('value' => 0, 'precision' => 0));
     foreach ($referenceSubject->occupations as $occupation) {
         $totalIncome->add($occupation->income);
     }
     //Get the current occupational status.
     $currentOccupationalStatus = '';
     foreach ($referenceSubject->occupations as $occupation) {
         if ($occupation->chronology == Model_Referencing_OccupationChronology::CURRENT) {
             if ($occupation->importance == Model_Referencing_OccupationImportance::FIRST) {
                 switch ($occupation->type) {
                     case Model_Referencing_OccupationTypes::EMPLOYMENT:
                         $currentOccupationalStatus = 'Employed';
                         break;
                     case Model_Referencing_OccupationTypes::CONTRACT:
                         $currentOccupationalStatus = 'On Contract';
                         break;
                     case Model_Referencing_OccupationTypes::SELFEMPLOYMENT:
                         $currentOccupationalStatus = 'Self Employed';
                         break;
                     case Model_Referencing_OccupationTypes::INDEPENDENT:
                         $currentOccupationalStatus = 'of Independent Means';
                         break;
                     case Model_Referencing_OccupationTypes::RETIREMENT:
                         $currentOccupationalStatus = 'Retired';
                         break;
                     case Model_Referencing_OccupationTypes::STUDENT:
                         $currentOccupationalStatus = 'Student';
                         break;
                     case Model_Referencing_OccupationTypes::UNEMPLOYMENT:
                         $currentOccupationalStatus = 'Unemployed';
                         break;
                 }
                 //Whilst we are here, determine if the occupation is permanent.
                 if ($occupation->isPermanent) {
                     $occupationChange = 'No';
                 } else {
                     $occupationChange = 'Yes';
                 }
                 break;
             }
         }
     }
     if (empty($referenceSubject->shareOfRent)) {
         $shareOfRent = 0;
     } else {
         $shareOfRent = $referenceSubject->shareOfRent->getValue();
     }
     if (empty($referenceSubject->dob)) {
         $dob = '0000-00-00';
     } else {
         $dob = $referenceSubject->dob->toString(Zend_Date::ISO_8601);
     }
     //Finally, push to munt
     $data = array('title' => empty($referenceSubject->name->title) ? '' : $referenceSubject->name->title, 'firstname' => empty($referenceSubject->name->firstName) ? '' : $referenceSubject->name->firstName, 'middlename' => empty($referenceSubject->name->middleName) ? '' : $referenceSubject->name->middleName, 'lastname' => empty($referenceSubject->name->lastName) ? '' : $referenceSubject->name->lastName, 'maidenname' => empty($referenceSubject->name->maidenName) ? '' : $referenceSubject->name->maidenName, 'dob' => $dob, 'tel' => empty($referenceSubject->contactDetails->telephone1) ? '' : $referenceSubject->contactDetails->telephone1, 'mobile' => empty($referenceSubject->contactDetails->telephone2) ? '' : $referenceSubject->contactDetails->telephone2, 'email' => empty($referenceSubject->contactDetails->email1) ? '' : $referenceSubject->contactDetails->email1, 'rstatus' => $currentResidentialStatus, 'estatus' => $currentOccupationalStatus, 'echange' => $occupationChange, 'RentShare' => $shareOfRent, 'income' => $totalIncome->getValue(), 'hasCCJs' => $referenceSubject->hasAdverseCredit == true ? 'Yes' : 'No', 'isForeignNational' => $referenceSubject->isForeignNational == true ? 'yes' : 'no', 'accountNo' => $accountNumber, 'sortcodeNo' => $sortCode, 'bankValidationCheckStatus' => $isValidated);
     return $this->insert($data);
 }
开发者ID:AlexEvesDeveloper,项目名称:hl-stuff,代码行数:92,代码来源:ReferenceSubject.php


注:本文中的Zend_Currency::getValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。