public function postEdit($id, EstateAdBindingModel $estate)
 {
     if ($this->estate->estateExist($id) !== 1) {
         Session::setError('The estate id is invalid');
         Redirect::back();
     }
     $estate->images = $this->reArrayFiles($estate->images);
     $validator = $this->validateEstateAd(new Validation(), $estate);
     if (!$validator->validate()) {
         Session::setError($validator->getErrors());
         Redirect::back();
     }
     $imageId = $this->estate->getMainImageId($id)['main_image_id'];
     if (isset($estate->main_image) && !empty($estate->main_image['name'])) {
         if (empty($imageId)) {
             $imageId = $this->addEstateMainImage($estate);
         } else {
             Session::setError('You have to delete the existed main image');
             Redirect::back();
         }
     }
     $this->estate->edit($id, $estate->location, $estate->price, $estate->area, $estate->floor, $estate->is_furnished, $estate->description, $estate->phone, $estate->category_id, $estate->city_id, $estate->ad_type, $imageId);
     $this->addEstateAdditionalImages($id, $estate);
     Session::setMessage('Estate Ad is edited successfully');
     Redirect::to('');
 }