1313 */
1414class Hm_Profiles {
1515
16- use Hm_Repository;
16+ use Hm_Repository, Searchable ;
1717
1818 private static $ data = array ();
1919
@@ -65,6 +65,15 @@ public static function getDefault() {
6565 return null ;
6666 }
6767
68+
69+ /**
70+ * Get the dataset for the server list
71+ * @return array
72+ */
73+ protected static function getDataset () {
74+ return self ::$ data ;
75+ }
76+
6877 public static function createDefault ($ hmod ) {
6978 if (! $ hmod ->module_is_supported ('imap ' ) || ! $ hmod ->module_is_supported ('smtp ' )) {
7079 return ;
@@ -84,6 +93,7 @@ public static function createDefault($hmod) {
8493 'address ' => $ address ,
8594 'replyto ' => $ reply_to ,
8695 'smtp_id ' => $ smtp_server ['id ' ],
96+ 'imap_id ' => $ imap_server ['id ' ],
8797 'sig ' => '' ,
8898 'rmk ' => '' ,
8999 'type ' => 'imap ' ,
@@ -109,6 +119,7 @@ public static function loadLegacy($hmod) {
109119 'address ' => array_key_exists ('profile_address ' , $ profile ) ? $ profile ['profile_address ' ] : '' ,
110120 'replyto ' => $ profile ['profile_replyto ' ],
111121 'smtp_id ' => $ profile ['profile_smtp ' ],
122+ 'imap_id ' => $ server ['id ' ],
112123 'sig ' => $ profile ['profile_sig ' ],
113124 'rmk ' => $ profile ['profile_rmk ' ],
114125 'type ' => 'imap ' ,
@@ -120,10 +131,10 @@ public static function loadLegacy($hmod) {
120131 }
121132
122133 /**
123- * @param string $field The name of the field to search within.
124- * @param mixed $value The value to search for within the specified field.
125- * @return array An array containing profiles that match the search criteria.
126- */
134+ * @param string $field The name of the field to search within.
135+ * @param mixed $value The value to search for within the specified field.
136+ * @return array An array containing profiles that match the search criteria.
137+ */
127138 public static function search ($ field , $ value ) {
128139 $ res = array ();
129140 foreach (self ::getAll () as $ profile ) {
0 commit comments