Contact.class.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. /**
  3. * Define a address
  4. * @author Valentin MORREEL
  5. * @category Core
  6. * @license copyright
  7. */
  8. class Contact extends Entity{
  9. public $id,$entity,$entity_id,$label,$type,$value,$state;
  10. //Phone constants
  11. const PHONE = 'phone';
  12. const MOBILE= 'mobile';
  13. //Mail constants
  14. const PERSONAL_MAIL = 'personal_mail';
  15. const PROFESSIONAL_MAIL = 'professional_mail';
  16. public $fields = array(
  17. 'id' => 'key',
  18. 'entity' => 'string',
  19. 'entity_id' => 'int',
  20. 'label' => 'string',
  21. 'type' => 'string',
  22. 'value' => 'string',
  23. 'state' => 'string'
  24. );
  25. public static function types($key=null){
  26. $types = array(
  27. self::PHONE => array(
  28. 'label' => "Tél. Fixe",
  29. 'icon' => "",
  30. 'color' => "",
  31. ),
  32. self::MOBILE => array(
  33. 'label' => "Tél. Mobile",
  34. 'icon' => "",
  35. 'color' => "",
  36. ),
  37. self::PERSONAL_MAIL => array(
  38. 'label' => "Mail perso.",
  39. 'icon' => "",
  40. 'color' => "",
  41. ),
  42. self::PROFESSIONAL_MAIL => array(
  43. 'label' => "Mail pro.",
  44. 'icon' => "",
  45. 'color' => "",
  46. ),
  47. );
  48. Plugin::callHook('contact_types', array(&$types));
  49. return isset($key) && isset($types[$key]) ? $types[$key] : $types;
  50. }
  51. }
  52. ?>