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


PHP Apartment::getFullDependency方法代码示例

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


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

示例1: actionExport

 public function actionExport()
 {
     $model = new $this->modelName();
     $photosExport = array();
     if (isset($_POST['ajax']) && $_POST['ajax'] === 'export-form') {
         echo CActiveForm::validate($model);
         Yii::app()->end();
     }
     if (isset($_POST[$this->modelName])) {
         $model->attributes = $_POST[$this->modelName];
         $arrSel = '';
         if (isset($_POST[$this->modelName]['itemsSelectedExport']) && $_POST[$this->modelName]['itemsSelectedExport']) {
             $arrSel = explode(',', $_POST[$this->modelName]['itemsSelectedExport']);
             $arrSel = array_map("intval", $arrSel);
         }
         if (!$arrSel || !count($arrSel)) {
             Yii::app()->user->setFlash('error', tt('Please select ads for export.'));
             $this->redirect('viewExport');
         } else {
             $backUrl = $this->createUrl('viewExport', array($this->modelName . '_sel' => $arrSel));
             $isZip = isset($_POST[$this->modelName]['isZip']) ? $_POST[$this->modelName]['isZip'] : 0;
             $fileName = date('Y_m_d_s') . rand(0, 9) . '_export.csv';
             $filePath = $model->csvPath . DIRECTORY_SEPARATOR . $fileName;
             $fileLine = array();
             $fileLine[0] = $this->mask;
             $i = 1;
             foreach ($arrSel as $v) {
                 // get needed info
                 $apartment = Apartment::model()->cache(param('cachingTime', 1209600), Apartment::getFullDependency($v))->with('windowTo', 'images')->findByPk($v);
                 // set values
                 $type = $apartment->type;
                 $priceType = $apartment->price_type;
                 $objType = $apartment->obj_type_id;
                 $countryName = $regionName = $cityName = '';
                 if (issetModule('location')) {
                     // country
                     if (isFree()) {
                         if ($apartment->loc_country) {
                             $countryInfo = Country::model()->findByPk($apartment->loc_country);
                             if ($countryInfo && isset($countryInfo->name)) {
                                 $countryName = $countryInfo->name;
                             }
                         }
                     } else {
                         if ($apartment->loc_country) {
                             Yii::app()->setLanguage($this->defLang);
                             $countryInfo = Country::model()->findByPk($apartment->loc_country);
                             if ($countryInfo && isset($countryInfo->name)) {
                                 $countryName = $countryInfo->name;
                             }
                             Yii::app()->setLanguage($this->currLang);
                         }
                     }
                     // region
                     if (isFree()) {
                         if ($apartment->loc_region) {
                             $regionInfo = Region::model()->findByPk($apartment->loc_region);
                             if ($regionInfo && isset($regionInfo->name)) {
                                 $regionName = $regionInfo->name;
                             }
                         }
                     } else {
                         if ($apartment->loc_region) {
                             Yii::app()->setLanguage($this->defLang);
                             $regionInfo = Region::model()->findByPk($apartment->loc_region);
                             if ($regionInfo && isset($regionInfo->name)) {
                                 $regionName = $regionInfo->name;
                             }
                             Yii::app()->setLanguage($this->currLang);
                         }
                     }
                     // city
                     if (isFree()) {
                         if ($apartment->loc_city) {
                             $cityInfo = City::model()->findByPk($apartment->loc_city);
                             if ($cityInfo && isset($cityInfo->name)) {
                                 $cityName = $cityInfo->name;
                             }
                         }
                     } else {
                         if ($apartment->loc_city) {
                             Yii::app()->setLanguage($this->defLang);
                             $cityInfo = City::model()->findByPk($apartment->loc_city);
                             if ($cityInfo && isset($cityInfo->name)) {
                                 $cityName = $cityInfo->name;
                             }
                             Yii::app()->setLanguage($this->currLang);
                         }
                     }
                 } else {
                     if (isFree()) {
                         if ($apartment->city_id) {
                             Yii::import('application.modules.apartmentCity.models.ApartmentCity');
                             $cityInfo = ApartmentCity::model()->findByPk($apartment->city_id);
                             if ($cityInfo && isset($cityInfo->name)) {
                                 $cityName = $cityInfo->name;
                             }
                         }
                     } else {
                         if ($apartment->city_id) {
//.........这里部分代码省略.........
开发者ID:barricade86,项目名称:raui,代码行数:101,代码来源:MainController.php


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