コード例 #1
0
 public function findData($filters = array())
 {
     $billAddr = array();
     $shipAddr = array();
     $oAddress = new AddressObject();
     $langId = Zend_Registry::get('languageID');
     $data = parent::findData($filters);
     if (!empty($data)) {
         $data = $data[0];
         $first = $data['MP_FirstParent'];
         $second = $data['MP_SecondParent'];
         $data['MP_BirthDateDt'] = $data['MP_BirthDate'];
         $oParent = new ParentProfilesObject();
         $firstPar = $oParent->getParentDetails($first, array('PP_GenericProfileId' => $first));
         $secPar = $oParent->getParentDetails($second, array('PP_GenericProfileId' => $second));
         if (!empty($firstPar)) {
             $firstLink = array($firstPar['RoleLabel'], $firstPar['GP_MemberID'], $firstPar['GP_FirstName'], $firstPar['GP_LastName'], $firstPar['PP_TaxReceipt']);
             $data['firstP'] = $firstLink;
         }
         if (!empty($secPar)) {
             $secLink = array($secPar['RoleLabel'], $secPar['GP_MemberID'], $secPar['GP_FirstName'], $secPar['GP_LastName'], $secPar['PP_TaxReceipt']);
             $data['secP'] = $secLink;
         }
         //            $billId = $data['MP_BillingAddrId'];
         //            $shipId = $data['MP_ShippingAddrId'];
         //
         //            if (!empty($shipId))
         //            {
         //                $shipAddr = $oAddress->getAll($langId, true, $shipId);
         //                $shipAddr = $shipAddr[0];
         //                $shipAddr['MP_ShippingAddrId'] = $shipId;
         //            }
         //
         //            if (!empty($billId))
         //            {
         //                $billAddr = $oAddress->getAll($langId, true, $billId);
         //                $billAddr = $billAddr[0];
         //                $billAddr['MP_BillingAddrId'] = $billId;
         //            }
         //
         //            if (isset($shipAddr['A_Duplicate']) && !$shipAddr['A_Duplicate'])
         //                $shipAddr['duplicate'] = 0;
         //
         //            $data['addressFact'] = $billAddr;
         //            $data['addressShipping'] = $shipAddr;
         $years = 0;
         if (isset($data['MP_BirthDate'])) {
             $years = $this->calculateAge($data['MP_BirthDate']);
         }
         $data['MP_Age'] = $years;
     }
     return $data;
 }