Skip to content

EN:DevTipsNTricks

Philipp Schüle edited this page Apr 24, 2019 · 1 revision

use search() efficiently

to only get the email column from addressbook contacts:

$filter = Tinebase_Model_Filter_FilterGroup::getFilterForModel(
            'Addressbook_Model_Contact',[['field' => 'type', 'operator' => 'equals', 'value' => 'user']]
          );
foreach ($adbCtrl->search($filter, null, false, [Tinebase_Backend_Sql_Abstract::IDCOL, 'email']) as $id => $email) {
  // do something with the email/id
}
You can’t perform that action at this time.