Skip to content
Browse files

Fix boolean to tinyint assignment.

  • Loading branch information...
1 parent 87a3c68 commit 0e10c28d02dbe9a511521815155722f6cbee4340 William Johnston committed Nov 2, 2013
Showing with 10 additions and 10 deletions.
  1. +10 −10 ACSSync.module
View
20 ACSSync.module
@@ -160,18 +160,18 @@ function acssync_sync() {
->fields(array(
'AddrId' => $address->AddrId,
'AddrType' => $address->AddrType,
- 'MailAddress' => $address->MailAddress,
+ 'MailAddress' => ($address->MailAddress) ? 1 : 0,
'Address2' => $address->Address2,
'City' => $address->City,
'Address' => $address->Address,
'Longitude' => $address->Longitude,
'State' => $address->State,
- 'ActiveAddress' => $address->ActiveAddress,
+ 'ActiveAddress' => ($address->ActiveAddress) ? 1 : 0,
'Zipcode' => $address->Zipcode,
- 'FamilyAddress' => $address->FamilyAddress,
+ 'FamilyAddress' => ($address->FamilyAddress) ? 1 : 0,
'Country' => $address->Country,
'Company' => $address->Company,
- 'StatementAddress' => $address->StatementAddress,
+ 'StatementAddress' => ($address->StatementAddress) ? 1 : 0,
'Latitude' => $address->Latitude,
'CityStateZip' => $address->CityStateZip,
'AddrTypeId' => $address->AddrTypeId,
@@ -210,11 +210,11 @@ function acssync_sync() {
'PhoneId' => $phone->PhoneId,
'PhoneTypeId' => $phone->PhoneTypeId,
'PhoneRef' => $phone->PhoneRef,
- 'Listed' => $phone->Listed,
+ 'Listed' => ($phone->Listed) ? 1 : 0,
'PhoneNumber' => $phone->PhoneNumber,
- 'Preferred' => (boolean) $phone->Preferred,
- 'FamilyPhone' => $phone->FamilyPhone,
- 'AddrPhone' => $phone->AddrPhone,
+ 'Preferred' => ($phone->Preferred) ? 1 : 0,
+ 'FamilyPhone' => ($phone->FamilyPhone) ? 1 : 0,
+ 'AddrPhone' => ($phone->AddrPhone) ? 1 : 0,
'Extension' => $phone->Extension,
'PhoneType' => $phone->PhoneType,
))
@@ -250,8 +250,8 @@ function acssync_sync() {
db_insert('accessacs_email')
->fields(array(
'EmailId' => $email->EmailId,
- 'Listed' => $email->Listed,
- 'Preferred' => (boolean) $email->Preferred,
+ 'Listed' => ($email->Listed) ? 1 : 0,
+ 'Preferred' => ($email->Preferred) ? 1 : 0,
'EmailType' => $email->EmailType,
'Email' => $email->Email,
))

0 comments on commit 0e10c28

Please sign in to comment.
Something went wrong with that request. Please try again.