/** * Updates properties and regenerate some of cached property data * @author Howard R <*****@*****.**> * @static * @param string $column * @param mixed $previous_value * @param mixed $new_value * @return boolean */ public static function update_properties($column, $previous_value, $new_value) { $listings = wpl_property::get_properties_list($column, $previous_value); $query = "UPDATE `#__wpl_properties` SET `{$column}`='{$new_value}' WHERE `{$column}`='{$previous_value}'"; $result = wpl_db::q($query); foreach ($listings as $listing) { $pid = $listing['id']; $property = self::get_property_raw_data($pid); wpl_property::update_text_search_field($pid); wpl_property::update_alias($property, $pid); wpl_property::update_numbs($pid, $property); /** generate rendered data **/ if (wpl_settings::get('cache')) { wpl_property::generate_rendered_data($pid); } } return $result; }
private function purge_related_property() { $listing_type_id = wpl_request::getVar('listing_type_id'); $properties_list = wpl_property::get_properties_list('listing', $listing_type_id); foreach ($properties_list as $property) { wpl_property::purge($property['id']); } $this->remove_listing_type($listing_type_id, 1); }
private function purge_related_property() { $property_type_id = wpl_request::getVar('property_type_id'); $properties_list = wpl_property::get_properties_list('property_type', $property_type_id); foreach ($properties_list as $property) { wpl_property::purge($property['id']); } self::remove_property_type($property_type_id, 1); }