Exemplo n.º 1
0
 private function getRecordsByPhoneNumber($number)
 {
     $phone_record = PhoneRecord::findOne(['number' => $number]);
     if (!$phone_record) {
         return [];
     }
     $customer_record = CustomerRecord::findOne($phone_record->customer_id);
     if (!$customer_record) {
         return [];
     }
     return [$this->makeCustomer($customer_record, $phone_record)];
 }