/** * @Author: ANH DUNG Aug 11, 2014 * @Todo: ghi đè file gốc rồi resize lại * @Param: $model model ProListingPhotos */ public static function OverideBigPhotoOfListing($model) { $fileName = $model->image; $id = $model->listing_id; $url_download = Yii::app()->createAbsoluteUrl('/') . "/upload/listing/{$id}/633x390/{$fileName}"; $pathSaveFile = "/upload/listing/{$id}"; // $pathSaveFile = "/".$fileFolder."/$fileModelId"; MyFormat::DownloadFile($url_download, $pathSaveFile, $fileName); }
} else { Subscriber::updateSubscriberUser($this->id); } // for subscriber check return parent::afterSave(); } public function activate() { $this->status = 1; $this->update(array('status')); } public function deactivate() { $this->status = 0; $this->update(array('status')); } public function behaviors() { return array('sluggable' => array('class' => 'application.extensions.mintao-yii-behavior-sluggable.SluggableBehavior', 'columns' => array('name_for_slug'), 'unique' => true, 'update' => true)); } public static function save_upload_employment_pass_passport($model) { if (!is_null($model->upload_employment_pass_passport)) { $model->upload_employment_pass_passport = self::saveFile($model, 'upload_employment_pass_passport', self::$folderUpload, 1);