FreenetIS
 All Classes Namespaces Functions Variables Pages
Public Member Functions | List of all members
Preprocessor_Model Class Reference

Due to memory consumption optimalizations some methods has been moved to this class. More...

Public Member Functions

 has_phone_invoices ($user_id)
 Check if given user has any phone invoice.
 count_unfilled_phone_invoices ($user_id)
 Gets count of unfilled users phone invoices.
 has_voip_sips ($user_id)
 Check if given user has any VoIP sips.
 count_all_unread_inbox_messages_by_user_id ($user_id)
 Returns count of all unread inbox messages of user.
 count_of_registered_members ()
 Function gets count of registered applicans.
 get_first_member_account_id ($member_id=NULL)
 Gets ID of member account if there is any.
 get_count_of_unvoted_works_of_voter ($user_id)
 Gets count of unvoted works of voter.
 get_count_of_unvoted_work_reports_of_voter ($user_id)
 Gets count of unvoted work reports of voter.
 get_count_of_unvoted_requests_of_voter ($user_id)
 Counts all unvoted requests of voter.
 count_off_down_devices ()
 Gets count of down devices.
 scount_unidentified_transfers ()
 Function gets count of unidentified transfers (simplified)
 get_allowed_subnet_by_member_and_ip_address ($member_id, $ip_address)
 Returns allowed subnet by member and ip address.
 count_of_unclosed_logs ($minimal_type=1)
 Gets count of unclosed logs with a minimal type.
 count_inactive_dhcp_servers ()
 Count inactive DHCP servers.
 is_users_favourite ($user_id, $page)
 Checks if user have given page in his favourites.
 get_users_favourites ($user_id, $limit_from=0, $limit_results=50, $order_by= 'title', $order_by_direction= 'asc')
 Returns all favourites of given user.
 count_undecided_requests ()
 Counts all undecided connection requests.
 count_all_disabled_allowed_subnets_by_member ($member_id)
 Counts all disabled and allowed subnets of member.
 get_subnet_for_connection_request ($ip_address)
 This method is used for determining whether the user is connected from registered connection.

Detailed Description

Due to memory consumption optimalizations some methods has been moved to this class.

Preprocessor now only loads one model for all these methods instead of one model for each method.

Author
David Raška

Member Function Documentation

Preprocessor_Model::count_all_disabled_allowed_subnets_by_member (   $member_id)

Counts all disabled and allowed subnets of member.

Copied from Allowed_subnets_Model

Author
Michal Kliment
Parameters
integer$member_id
Returns
integer
Preprocessor_Model::count_all_unread_inbox_messages_by_user_id (   $user_id)

Returns count of all unread inbox messages of user.

Moved from Mail_message_Model

Author
Michal Kliment
Parameters
number$user_id
Returns
number
Preprocessor_Model::count_inactive_dhcp_servers ( )

Count inactive DHCP servers.

Moved from Device_Model

Returns
int
Preprocessor_Model::count_of_registered_members ( )

Function gets count of registered applicans.

Moved from Member_Model

constant 1 equals Member_Model::TYPE_APPLICANT - memory consumption hack

Returns
integer
Preprocessor_Model::count_of_unclosed_logs (   $minimal_type = 1)

Gets count of unclosed logs with a minimal type.

Moved from Log_queue_Model

constant 1 equals Log_queue_Model::TYPE_ERROR - memory consumption hack constant 1 equals Log_queue_Model::STATE_CLOSED - memory consumption hack

Parameters
int$minimal_typeMinimal counted type (e.g. ERROR -> ERROR & FERROR)
Returns
int Count
Preprocessor_Model::count_off_down_devices ( )

Gets count of down devices.

Moved from Monitor_host_Model

constant 2 equals Monitor_host_Model::STATE_DOWN - memory consumption hack

See Also
My_Controller
Returns
integer
Preprocessor_Model::count_undecided_requests ( )

Counts all undecided connection requests.

constant 0 equals Connection_request_Model::STATE_UNDECIDED - memory consumption hack

Returns
integer
Preprocessor_Model::count_unfilled_phone_invoices (   $user_id)

Gets count of unfilled users phone invoices.

Moved from Phone_invoices_user_Model

Parameters
integer$user_idUser
Returns
integer
Preprocessor_Model::get_allowed_subnet_by_member_and_ip_address (   $member_id,
  $ip_address 
)

Returns allowed subnet by member and ip address.

Moved from Allowed_subnet_Model

Author
Michal Kliment
Parameters
integer$member_id
string$ip_address
Returns
Mysql_Result object
Preprocessor_Model::get_count_of_unvoted_requests_of_voter (   $user_id)

Counts all unvoted requests of voter.

Moved from Request_Model

Author
Michal Kliment
Parameters
integer$user_id
Returns
integer
Preprocessor_Model::get_count_of_unvoted_work_reports_of_voter (   $user_id)

Gets count of unvoted work reports of voter.

Moved from Job_reports_Model

Parameters
integer$user_idID of voter
Returns
integer
Preprocessor_Model::get_count_of_unvoted_works_of_voter (   $user_id)

Gets count of unvoted works of voter.

Moved from Job_Model

Parameters
integer$user_idID of voter
Returns
integer
Preprocessor_Model::get_first_member_account_id (   $member_id = NULL)

Gets ID of member account if there is any.

Moved from Member_Model

Parameters
integer$member_id
Returns
integer
Preprocessor_Model::get_subnet_for_connection_request (   $ip_address)

This method is used for determining whether the user is connected from registered connection.

If he is the null is returned. If not then subnet from which he is connected is searched. If the user may obtain this IP from the searched subnet the ID of subnet is returned. (but there must not be any connection request on this connection already in tha database)

Copied from Subnet_Model

constant 0 equals Connection_request_Model::STATE_UNDECIDED - memory consumption hack

Author
Ondřej Fibich
Parameters
string$ip_addressIP address from which the connection request is made
Returns
int|null Subnet ID or null if invalid request was made
Preprocessor_Model::get_users_favourites (   $user_id,
  $limit_from = 0,
  $limit_results = 50,
  $order_by = 'title',
  $order_by_direction = 'asc' 
)

Returns all favourites of given user.

Copied from User_favourite_pages_Model

Parameters
int$user_idUser ID
Returns
ORM object
Preprocessor_Model::has_phone_invoices (   $user_id)

Check if given user has any phone invoice.

Moved from Phone_invoices_user_Model

Parameters
integer$user_idUser
Returns
bool Has?
Preprocessor_Model::has_voip_sips (   $user_id)

Check if given user has any VoIP sips.

Moved from Voip_sip_Model

Author
Ondřej Fibich
Parameters
integer$user_idUser
Returns
bool Has?
Preprocessor_Model::is_users_favourite (   $user_id,
  $page 
)

Checks if user have given page in his favourites.

Copied from User_favourite_pages_Model

Parameters
int$user_id
string$page
Returns
bool TRUE if page is favourite
Preprocessor_Model::scount_unidentified_transfers ( )

Function gets count of unidentified transfers (simplified)

Moved from Bank_transfer_Model

constant 684000 equals Account_attribute_Model::MEMBER_FEES - memory consumption hack

Returns
integer

The documentation for this class was generated from the following file: