public function OnAutoContract($sender) { $text = $sender->getValue(); return Document::findArray('document_number', "document_number like '%{$text}%' and ( meta_name='Contract' or meta_name='SupplierOrder' )"); }