FreenetIS
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Public Attributes | Protected Attributes | List of all members
Contact_Model Class Reference
Inheritance diagram for Contact_Model:
ORM

Public Member Functions

 is_users_contact ($user_id)
 Check if user own this contact.
 is_user_redirected_email ($user_id)
 Check if the given user own this contact and also whether the contact is an e-mail address with set up redirection from the inner mail.
 set_user_redirected_email ($user_id, $redirect)
 Set state of e-mail inner mail redirection.
 count_all_users_contacts_relation ($contact_id=NULL)
 Search for relation between users and countacts (users_contacts)
 count_all_relation ()
 Search for all relation between users and countacts (users_contacts, private_users_contacts)
 count_all_users_contacts ($user_id, $type=NULL)
 Returns count of users contacts.
 find_all_users_contacts ($user_id, $type=NULL)
 Returns all users contacts (id is from table contacts)
 find_all_private_users_contacts ($user_id)
 Returns all private users contacts (id is from table private_users_contacts)
 find_contact_id ($type, $value)
 Find for contact id.
 find_contacts ($type, $value)
 Find for contacts.
 get_phone_prefix ()
 Gets prefix of phone country code.

Public Attributes

const TYPE_ICQ = 18
const TYPE_JABBER = 19
const TYPE_EMAIL = 20
const TYPE_PHONE = 21
const TYPE_SKYPE = 22
const TYPE_MSN = 23
const TYPE_WEB = 25

Protected Attributes

 $has_many
 $has_and_belongs_to_many

Member Function Documentation

Contact_Model::count_all_relation ( )

Search for all relation between users and countacts (users_contacts, private_users_contacts)

Returns
integer Number of relation
Contact_Model::count_all_users_contacts (   $user_id,
  $type = NULL 
)

Returns count of users contacts.

Parameters
int$user_id
int$typeContacts type
Returns
int
Contact_Model::count_all_users_contacts_relation (   $contact_id = NULL)

Search for relation between users and countacts (users_contacts)

Parameters
integer$contact_id
Returns
integer Number of relation
Contact_Model::find_all_private_users_contacts (   $user_id)

Returns all private users contacts (id is from table private_users_contacts)

Parameters
int$user_id
Returns
Mysql_Result
Contact_Model::find_all_users_contacts (   $user_id,
  $type = NULL 
)

Returns all users contacts (id is from table contacts)

Parameters
int$user_id
int$typeContacts type
Returns
Mysql_Result
Contact_Model::find_contact_id (   $type,
  $value 
)

Find for contact id.

Parameters
string$typeType of contact
string$valueValue of contact
Returns
id or false if does't exists
Contact_Model::find_contacts (   $type,
  $value 
)

Find for contacts.

Parameters
string$typeType of contact
string$valueValue of contact
Returns
Mysql_Result
Contact_Model::get_phone_prefix ( )

Gets prefix of phone country code.

Author
Ondřej Fibich
Returns
string Prefix or empty string
Contact_Model::is_user_redirected_email (   $user_id)

Check if the given user own this contact and also whether the contact is an e-mail address with set up redirection from the inner mail.

Parameters
integer$user_id
Returns
boolean
Contact_Model::is_users_contact (   $user_id)

Check if user own this contact.

Parameters
integer$user_id
Returns
boolean
Contact_Model::set_user_redirected_email (   $user_id,
  $redirect 
)

Set state of e-mail inner mail redirection.

Parameters
integer$user_id
boolean$redirectIS redirection enabled?

Member Data Documentation

Contact_Model::$has_and_belongs_to_many
protected
Initial value:
array
(
'users_contacts' => 'users', 'countries'
)
Contact_Model::$has_many
protected
Initial value:
array
(
'users' => 'private_users_contacts'
)

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