예제 #1
0
 /**
  * Fix Aliases for all languages
  * @author Howard <*****@*****.**>
  * @static
  * @param array $property_data
  * @param int $property_id
  */
 public static function fix_aliases($property_data, $property_id = 0)
 {
     /** fetch property data if property id is setted **/
     if ($property_id) {
         $property_data = self::get_property_raw_data($property_id);
     }
     if (!$property_id) {
         $property_id = $property_data['id'];
     }
     $columns = wpl_global::get_multilingual_columns(array('alias'), 'wpl_properties');
     foreach ($columns as $column) {
         $alias = wpl_db::escape(wpl_global::url_encode($property_data[$column]));
         $query = "UPDATE `#__wpl_properties` SET `{$column}`='{$alias}' WHERE `id`='{$property_id}'";
         wpl_db::q($query, 'UPDATE');
     }
 }