\Table_Model

Data model

Summary

Methods
Properties
Constants
__construct()
init_model_data_from_request()
convertDistMeashures()
convertAreaMeashures()
init_language_values()
init_model_data_from_db_multi()
init_model_data_from_db()
init_model_data_from_db_language()
init_model_data_from_var()
get_string_value_by_id()
get_values_list()
check_data()
forse_auto_add_values()
forse_autocalc_values()
forse_injected_values()
get_value_id_by_name()
get_insert_query()
get_prepared_insert_query()
get_prepared_edit_query()
get_edit_query()
get_city_model()
get_region_model()
get_district_model()
try_get_model_from_db()
get_metro_model()
get_street_model()
get_country_model()
get_ipoteka_model()
_get_ipoteka_model()
get_kvartira_model()
_get_kvartira_model()
_get_big_city_kvartira_model()
_get_big_city_kvartira_model2()
define_kgs_titles()
SiteBill()
getCurrentLang()
getRealtyHREF()
_getGridConstructor()
getAttachments()
appendAttachments()
escape()
getAdminTplFolder()
get_breadcrumbs()
get_ajax_functions()
get_apps_template_full_path()
getPageByURI()
get_session_key()
delete_session_key()
getSessionUserId()
load_uploadify_images()
editImageMulti()
setExternalUploadifyImageArray()
getExternalUploadifyImageArray()
appendDocUploads()
appendUploads()
editFileMulti()
clear_uploadify_table()
clear_captcha_session_table()
clear_session_table()
delete_uploadify_images()
delete_uploadify_image()
get_ajax_auth_form()
get_simple_auth_form()
add_image_records()
add_table_image_record()
getPluploaderPlugin()
getUploadifyPlugin()
getDropzonePlugin()
getUploadifyFilePlugin()
isDemo()
demo_function_disabled()
loadConfig()
deleteImage()
makeImageMain()
rotateImage2()
rotateImage()
reorderImage()
reorderTopics()
deleteImageFiles()
getConfigValue()
getAllConfigArray()
getDebugMode()
setDebugMode()
htmlspecialchars()
htmlspecialchars_decode()
getRequestValue()
setRequestValue()
riseError()
clearError()
getError()
GetErrorMessage()
writeLog()
getImageListAdmin()
getFileListAdmin()
get_page_links_list()
get_image_array()
get_category_breadcrumbs()
get_category_breadcrumbs_string()
set_breadcrumbs_array()
get_breadcrumbs_array()
go301()
makePreview()
makeMove()
getAdminUserId()
getVendorInfoById()
getUnregisteredUserId()
growCounter()
validateEmailFormat()
validateMobilePhoneNumberFormat()
getAttachmentsBlock()
modelSimplification()
iconv()
removeDirectory()
transliteMe()
setLangSession()
getClearRequestURI()
sendFirmMail()
check_access()
need_check_access()
get_check_access_user_id()
get_model()
$error_message
$uploadify_dir
$storage_dir
$_grid_constructor_local
$_grid_viewer_local
MEDIA_SAVE_FOLDER
intit_from_db_mass()
getServerFullUrl()
initLocalComponents()
parseLocalSettings()
_setGridConstructor()
restoreFavorites()
$config_loaded
$config_array
$storage
$Heaps
$localSettings
$_grid_constructor
N/A
xssProtect()
getSafeValue()
$external_uploadify_image_array
N/A

Constants

MEDIA_SAVE_FOLDER

MEDIA_SAVE_FOLDER

Properties

$error_message

$error_message : 

Error message

Type

$uploadify_dir

$uploadify_dir : 

Type

$storage_dir

$storage_dir : 

Type

$_grid_constructor_local

$_grid_constructor_local : 

Type

$_grid_viewer_local

$_grid_viewer_local : 

Type

$config_loaded

$config_loaded : 

Type

$config_array

$config_array : 

Type

$storage

$storage : 

Type

$Heaps

$Heaps : 

Type

$localSettings

$localSettings : 

Type

$_grid_constructor

$_grid_constructor : 

Type

$external_uploadify_image_array

$external_uploadify_image_array : 

Type

Methods

__construct()

__construct() 

Construct

init_model_data_from_request()

init_model_data_from_request(array  $model_array,   $ignore_topic_activity = false,   $no_insert = false) : boolean

Init model data from request

Parameters

array $model_array
$ignore_topic_activity
$no_insert

Returns

boolean

convertDistMeashures()

convertDistMeashures(  $val,   $from,   $to = 'm') 

Parameters

$val
$from
$to

convertAreaMeashures()

convertAreaMeashures(  $val,   $from,   $to = 'sqm') 

Parameters

$val
$from
$to

init_language_values()

init_language_values(array  $model_array,   $model_array_language = array()) : array

Init language values in model array with data

Parameters

array $model_array
$model_array_language

Returns

array

init_model_data_from_db_multi()

init_model_data_from_db_multi(  $table_name,   $primary_key_name,   $primary_key_values,   $model_array,   $force_select_values = false,   $simplificate = false,   $trimmed_data = false) 

Parameters

$table_name
$primary_key_name
$primary_key_values
$model_array
$force_select_values
$simplificate
$trimmed_data

init_model_data_from_db()

init_model_data_from_db(  $table_name,   $primary_key_name,   $primary_key_value,   $model_array,   $force_select_values = false) 

Parameters

$table_name
$primary_key_name
$primary_key_value
$model_array
$force_select_values

init_model_data_from_db_language()

init_model_data_from_db_language(string  $table_name, string  $primary_key_name, integer  $primary_key_value, array  $model_array, boolean  $force_select_values, integer  $language_id) : boolean

Init model data from db (language_version)

Parameters

string $table_name
string $primary_key_name

primary key name

integer $primary_key_value

primary key

array $model_array
boolean $force_select_values
integer $language_id

Returns

boolean

init_model_data_from_var()

init_model_data_from_var(  $var,   $primary_key_value,   $model_array,   $force_select_values = false) 

Parameters

$var
$primary_key_value
$model_array
$force_select_values

get_string_value_by_id()

get_string_value_by_id(string  $primary_key_table, string  $primary_key_name, string  $value_name,   $value, boolean  $cache = false) : string

Get string value by ID

Parameters

string $primary_key_table
string $primary_key_name
string $value_name
$value
boolean $cache

use cache

Returns

string

get_values_list()

get_values_list(  $what,   $primary_table_name, string  $primary_key_name,   $secondary_table_name,   $secondary_key_name,   $value) : string

Get string values from outer table by ID

Parameters

$what
$primary_table_name
string $primary_key_name
$secondary_table_name
$secondary_key_name
$value

Returns

string

check_data()

check_data(array  $model_array,   $error_fields = array()) : boolean

Check data

Parameters

array $model_array
$error_fields

Returns

boolean

forse_auto_add_values()

forse_auto_add_values(  $model_array) 

Parameters

$model_array

forse_autocalc_values()

forse_autocalc_values(  $model_array) 

Parameters

$model_array

forse_injected_values()

forse_injected_values(  $model_array) 

Parameters

$model_array

get_value_id_by_name()

get_value_id_by_name(  $table,   $field,   $primary_key,   $value,   $filters = array()) : \возвращаем

Получить ID записи по значению одного из столбцов

Parameters

$table
$field
$primary_key
$value
$filters

Returns

\возвращаем —

ID записи или FALSE если запись не найдена

get_insert_query()

get_insert_query(string  $table_name, array  $model_array, integer  $language_id) : boolean

Get insert query

Parameters

string $table_name

table name

array $model_array
integer $language_id

Returns

boolean

get_prepared_insert_query()

get_prepared_insert_query(  $table_name,   $model_array,   $language_id) 

Parameters

$table_name
$model_array
$language_id

get_prepared_edit_query()

get_prepared_edit_query(  $table_name,   $primary_key_name,   $primary_key_value,   $model_array,   $language_id) 

Parameters

$table_name
$primary_key_name
$primary_key_value
$model_array
$language_id

get_edit_query()

get_edit_query(string  $table_name, string  $primary_key_name, integer  $primary_key_value, array  $model_array, integer  $language_id) : boolean

Get edit query

Parameters

string $table_name

table name

string $primary_key_name

primary key name

integer $primary_key_value

primary key

array $model_array
integer $language_id

Returns

boolean

get_city_model()

get_city_model() : 

Get city model

Returns

get_region_model()

get_region_model() : 

Get region model

Returns

get_district_model()

get_district_model() : 

Get district model

Returns

try_get_model_from_db()

try_get_model_from_db(  $table_name,   $exist_model) 

Parameters

$table_name
$exist_model

get_metro_model()

get_metro_model() : 

Get metro model

Returns

get_street_model()

get_street_model() : 

Get street model

Returns

get_country_model()

get_country_model() : 

Get country model

Returns

get_ipoteka_model()

get_ipoteka_model(  $ajax = false) 

Parameters

$ajax

_get_ipoteka_model()

_get_ipoteka_model(boolean  $ajax = false) : array

Get ipoteka model

Parameters

boolean $ajax

mode

Returns

array

get_kvartira_model()

get_kvartira_model(boolean  $ajax = false,   $ignore_user_group = false) : array

Get kvartira model

Parameters

boolean $ajax

mode

$ignore_user_group

Returns

array

_get_kvartira_model()

_get_kvartira_model(  $ajax = false) 

Parameters

$ajax

_get_big_city_kvartira_model()

_get_big_city_kvartira_model(  $ajax = false) 

Parameters

$ajax

_get_big_city_kvartira_model2()

_get_big_city_kvartira_model2(  $ajax = false) 

Parameters

$ajax

define_kgs_titles()

define_kgs_titles(  $form_data) 

Parameters

$form_data

SiteBill()

SiteBill() 

Constructor

getCurrentLang()

getCurrentLang() 

getRealtyHREF()

getRealtyHREF(  $rid,   $external = false,   $params = array()) 

Parameters

$rid
$external
$params

_getGridConstructor()

_getGridConstructor() 

getAttachments()

getAttachments(  $object_type,   $object_id) 

Parameters

$object_type
$object_id

appendAttachments()

appendAttachments(  $object_type,   $object_id,   $attachments) 

Parameters

$object_type
$object_id
$attachments

escape()

escape(  $text) 

Parameters

$text

getAdminTplFolder()

getAdminTplFolder() 

get_breadcrumbs()

get_breadcrumbs(array  $items) : string

Get breadcrumbs

Parameters

array $items

Returns

string

get_ajax_functions()

get_ajax_functions() 

get_apps_template_full_path()

get_apps_template_full_path(string  $apps_name, string  $theme, string  $template_value) : boolean

Get apps template full path

Parameters

string $apps_name
string $theme
string $template_value

Returns

boolean

getPageByURI()

getPageByURI(string  $uri) : array

Get page by URI

Parameters

string $uri

uri

Returns

array

get_session_key()

get_session_key() : string

Get session key

Returns

string

delete_session_key()

delete_session_key(string  $session_key) : void

Delete session by key

Parameters

string $session_key

getSessionUserId()

getSessionUserId() : integer

Get session user ID

Returns

integer

load_uploadify_images()

load_uploadify_images(string  $session_code = '',   $element_name = '') : array

Load uploadify images

Parameters

string $session_code

session code

$element_name

Returns

array

editImageMulti()

editImageMulti(string  $action, string  $table_name, string  $key, integer  $record_id,   $name_template = '') : boolean

Edit image

Parameters

string $action

action

string $table_name

table name

string $key

key

integer $record_id

record ID

$name_template

Returns

boolean

setExternalUploadifyImageArray()

setExternalUploadifyImageArray(  $_image_array) : void

Эта функция устанавливает массив с картинками для эмитации загрузки картинок в UPLOADIFY Используется в APPS.API для загрузки картинок из мобильного приложения

Parameters

$_image_array
  • массив с картинками

getExternalUploadifyImageArray()

getExternalUploadifyImageArray() 

appendDocUploads()

appendDocUploads(  $table,   $field,   $pk_field,   $record_id) 

Parameters

$table
$field
$pk_field
$record_id

appendUploads()

appendUploads(  $table,   $field,   $pk_field,   $record_id,   $name_template = '') 

Parameters

$table
$field
$pk_field
$record_id
$name_template

editFileMulti()

editFileMulti(string  $action, string  $table_name, string  $key, integer  $record_id) : boolean

Edit file

Parameters

string $action

action

string $table_name

table name

string $key

key

integer $record_id

record ID

Returns

boolean

clear_uploadify_table()

clear_uploadify_table(  $session_code = '',   $anyway = false) 

Parameters

$session_code
$anyway

clear_captcha_session_table()

clear_captcha_session_table() 

clear_session_table()

clear_session_table() 

delete_uploadify_images()

delete_uploadify_images(string  $session_code,   $element = '') : array

Delete uploadify images

Parameters

string $session_code

session code

$element

Returns

array

delete_uploadify_image()

delete_uploadify_image(string  $image_name) : array

Delete uploadify image

Parameters

string $image_name

image_name

Returns

array

get_ajax_auth_form()

get_ajax_auth_form() 

get_simple_auth_form()

get_simple_auth_form(string  $action = '/login/', boolean  $register = true, boolean  $remind = true) : string

Get simple auth form

Parameters

string $action
boolean $register
boolean $remind

Returns

string

add_image_records()

add_image_records(array  $images, string  $table_name, string  $key, integer  $record_id) : boolean

Add image data records

Parameters

array $images

images

string $table_name

table name

string $key

key

integer $record_id

record id

Returns

boolean

add_table_image_record()

add_table_image_record(  $table_name,   $key, integer  $record_id, integer  $image_id) : boolean

Add table_image record

Parameters

$table_name
$key
integer $record_id

record id

integer $image_id

image id

Returns

boolean

getPluploaderPlugin()

getPluploaderPlugin(string  $session_code) : string

Get Plupload plugin (http://www.plupload.com/) Only html4 version available (not attached files for others)

Parameters

string $session_code

session code

Returns

string

getUploadifyPlugin()

getUploadifyPlugin(string  $session_code,   $params = array()) : string

Get uploadify plugin

Parameters

string $session_code

session code

$params

Returns

string

getDropzonePlugin()

getDropzonePlugin(  $session_code,   $params = array()) 

Parameters

$session_code
$params

getUploadifyFilePlugin()

getUploadifyFilePlugin(string  $session_code,   $params = array()) : string

Get uploadify plugin

Parameters

string $session_code

session code

$params

Returns

string

isDemo()

isDemo() : boolean

Is demo

Returns

boolean

demo_function_disabled()

demo_function_disabled() : string

Demo function disabled

Returns

string

loadConfig()

loadConfig() : 

Load config

Returns

deleteImage()

deleteImage(string  $table_name, integer  $image_id) : boolean

Delete image

Parameters

string $table_name

table name

integer $image_id

image id

Returns

boolean

makeImageMain()

makeImageMain(  $action,   $image_id,   $key,   $key_value) 

Parameters

$action
$image_id
$key
$key_value

rotateImage2()

rotateImage2(  $thisimage,   $isWatermark,   $degree,   $parameters) 

Parameters

$thisimage
$isWatermark
$degree
$parameters

rotateImage()

rotateImage(  $action,   $image_id,   $key,   $key_value,   $rot_dir) 

Parameters

$action
$image_id
$key
$key_value
$rot_dir

reorderImage()

reorderImage(  $action,   $image_id,   $key,   $key_value,   $direction) 

Parameters

$action
$image_id
$key
$key_value
$direction

reorderTopics()

reorderTopics(  $orderArray) 

Parameters

$orderArray

deleteImageFiles()

deleteImageFiles(  $image_id) : boolean

Delete image files

Parameters

$image_id

image id

Returns

boolean

getConfigValue()

getConfigValue(string  $key) : string

Get config value

Parameters

string $key

key

Returns

string

getAllConfigArray()

getAllConfigArray() 

getDebugMode()

getDebugMode() : boolean

Get debug mode

Returns

boolean

setDebugMode()

setDebugMode(  $debug_mode) : void

Set debug mode

Parameters

$debug_mode

htmlspecialchars()

htmlspecialchars(  $value,   $flags = '') 

Parameters

$value
$flags

htmlspecialchars_decode()

htmlspecialchars_decode(  $value,   $flags = '') 

Parameters

$value
$flags

getRequestValue()

getRequestValue(string  $key,   $type = '',   $from = '') : string

Get value

Parameters

string $key

key

$type
$from

Returns

string

setRequestValue()

setRequestValue(string  $key, string  $value) : void

Set request value

Parameters

string $key

key

string $value

value

riseError()

riseError(  $error_message) : void

Rise error

Parameters

$error_message

clearError()

clearError() 

getError()

getError() : boolean

Get error

Returns

boolean

GetErrorMessage()

GetErrorMessage() : string

Get error message

Returns

string

writeLog()

writeLog(string  $message) : void

Write log message

Parameters

string $message

message

getImageListAdmin()

getImageListAdmin(string  $action, string  $table_name, string  $key, integer  $record_id,   $callback_count = NULL,   $no_controls = false) : string

Get image list admin

Parameters

string $action

action

string $table_name

table name

string $key

key

integer $record_id

record id

$callback_count
$no_controls

Returns

string

getFileListAdmin()

getFileListAdmin(string  $action, string  $table_name, string  $key, integer  $record_id) : string

Get file list admin

Parameters

string $action

action

string $table_name

table name

string $key

key

integer $record_id

record id

Returns

string

get_page_links_list()

get_page_links_list(  $page, integer  $total, integer  $per_page, array  $params) : array

Get page links list

Parameters

$page
integer $total
integer $per_page
array $params

Returns

array

get_image_array()

get_image_array(string  $action, string  $table_name, string  $key, integer  $record_id, integer  $limit) : string

Get image list admin

Parameters

string $action

action

string $table_name

table name

string $key

key

integer $record_id

record id

integer $limit

limit value

Returns

string

get_category_breadcrumbs()

get_category_breadcrumbs(array  $params, array  $category_structure, string  $url = '') : string

Get category breadcrumbs

Parameters

array $params
array $category_structure
string $url

Returns

string

get_category_breadcrumbs_string()

get_category_breadcrumbs_string(array  $params, array  $category_structure, string  $url = '') : string

Get category breadcrumbs

Parameters

array $params
array $category_structure
string $url

Returns

string

set_breadcrumbs_array()

set_breadcrumbs_array(  $breadcrumbs_array = array()) 

Parameters

$breadcrumbs_array

get_breadcrumbs_array()

get_breadcrumbs_array() 

go301()

go301(  $new_location) 

Parameters

$new_location

makePreview()

makePreview(  $src,   $dst,   $width,   $height,   $ext = 'jpg',   $md) : 

Make preview

Parameters

$src
$dst
$width
$height
$ext
$md

Returns

makeMove()

makeMove(  $src,   $dst) : 

Make move

Parameters

$src
$dst

Returns

getAdminUserId()

getAdminUserId() : integer

return id of Admininstrator

Returns

integer

getVendorInfoById()

getVendorInfoById(  $id) : string

return Vendor info

Parameters

$id

Returns

string

getUnregisteredUserId()

getUnregisteredUserId() 

growCounter()

growCounter(  $table_name,   $primary_key_name,   $primary_key_value,   $user_id) 

Parameters

$table_name
$primary_key_name
$primary_key_value
$user_id

validateEmailFormat()

validateEmailFormat(  $email) 

Parameters

$email

validateMobilePhoneNumberFormat()

validateMobilePhoneNumberFormat(  $phone_number,   $mask = '') 

Parameters

$phone_number
$mask

getAttachmentsBlock()

getAttachmentsBlock() 

modelSimplification()

modelSimplification(  $model) 

Parameters

$model

iconv()

iconv(  $in_charset,   $out_charset,   $string) 

Parameters

$in_charset
$out_charset
$string

removeDirectory()

removeDirectory(  $dir,   $msg = array()) 

Parameters

$dir
$msg

transliteMe()

transliteMe(  $str) 

Parameters

$str

setLangSession()

setLangSession() 

getClearRequestURI()

getClearRequestURI() 

sendFirmMail()

sendFirmMail(  $to,   $from,   $subject,   $body) 

Parameters

$to
$from
$subject
$body

check_access()

check_access(\type  $table_name, \type  $user_id, \type  $control_name, \type  $primary_key_name, \type  $primary_key_value) : boolean

Проверка владельца записи в таблице по USER_ID, если владелец совпадает с $table_name.user_id тогда возвращаем TRUE иначе FALSE

Parameters

\type $table_name
  • название таблицы
\type $user_id
  • идентификатор пользователя для проверки
\type $control_name
  • тип действия (edit, delete...)
\type $primary_key_name
  • название PRIMARY KEY в таблице
\type $primary_key_value
  • значение PRIMARY KEY

Returns

boolean

need_check_access()

need_check_access(  $table_name) 

Parameters

$table_name

get_check_access_user_id()

get_check_access_user_id(  $table_name) 

Parameters

$table_name

get_model()

get_model() 

intit_from_db_mass()

intit_from_db_mass(  $table_name,   $primary_key_name,   $primary_key_value,   $model_array) 

Parameters

$table_name
$primary_key_name
$primary_key_value
$model_array

getServerFullUrl()

getServerFullUrl(  $domain_only = false) 

Parameters

$domain_only

initLocalComponents()

initLocalComponents() 

parseLocalSettings()

parseLocalSettings() 

_setGridConstructor()

_setGridConstructor(  $newGridConstructor) 

Parameters

$newGridConstructor

restoreFavorites()

restoreFavorites(  $user_id) 

Parameters

$user_id

xssProtect()

xssProtect(  $value) 

Parameters

$value

getSafeValue()

getSafeValue(  $value) 

Parameters

$value