Skip to content

Commit

Permalink
Add fields specific to the individual over the more general retrieval.
Browse files Browse the repository at this point in the history
  • Loading branch information
William Johnston committed Oct 31, 2013
1 parent 0b0b77f commit a61841c
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 49 deletions.
133 changes: 84 additions & 49 deletions ACSSync.install
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -18,59 +18,94 @@ function acs_sync_schema() {
'MiddleName' => array( 'MiddleName' => array(
'description' => t('The middle name of this individual'), 'description' => t('The middle name of this individual'),
'type' => 'varchar', 'type' => 'varchar',
'length' => 32, 'length' => 255,
'not null' => FALSE, 'not null' => false,
'default' => '' 'default' => ''
), ),
'GoesByName' => array( 'GoesByName' => array(
'description' => t('The commonly used name for this individual'), 'description' => t('The commonly used name for this individual'),
'type' => 'varchar', 'type' => 'varchar',
'length' => 32, 'length' => 255,
'not null' => FALSE, 'not null' => false,
'default' => '' 'default' => ''
), ),
'Title' => array( 'Title' => array(
'description' => t('The title for this individual'), 'description' => t('The title for this individual'),
'type' => 'varchar', 'type' => 'varchar',
'length' => 32, 'length' => 255,
'not null' => FALSE, 'not null' => false,
'default' => '' 'default' => ''
), ),
'LastName' => array( 'LastName' => array(
'description' => t('The LastName for this individual'), 'description' => t('The LastName for this individual'),
'type' => 'varchar', 'type' => 'varchar',
'length' => 32, 'length' => 255,
'not null' => FALSE, 'not null' => false,
'default' => '' 'default' => ''
), ),
'FirstName' => array( 'FirstName' => array(
'description' => t('The FirstName for this individual'), 'description' => t('The FirstName for this individual'),
'type' => 'varchar', 'type' => 'varchar',
'length' => 32, 'length' => 255,
'not null' => FALSE, 'not null' => false,
'default' => '' 'default' => ''
), ),
'PictureUrl' => array( 'PictureUrl' => array(
'description' => t('The PictureUrl for this individual'), 'description' => t('The PictureUrl for this individual'),
'type' => 'varchar', 'type' => 'varchar',
'length' => 32, 'length' => 255,
'not null' => FALSE, 'not null' => false,
'default' => '' 'default' => ''
), ),
'FamilyPosition' => array( 'FamilyPosition' => array(
'description' => t('The FamilyPosition for this individual'), 'description' => t('The FamilyPosition for this individual'),
'type' => 'varchar', 'type' => 'varchar',
'length' => 32, 'length' => 255,
'not null' => FALSE, 'not null' => false,
'default' => '' 'default' => ''
), ),
'Suffix' => array( 'Suffix' => array(
'description' => t('The Suffix for this individual'), 'description' => t('The Suffix for this individual'),
'type' => 'varchar', 'type' => 'varchar',
'length' => 32, 'length' => 255,
'not null' => FALSE, 'not null' => false,
'default' => '' 'default' => ''
), ),
'FullName' => array(
'description' => t('The FullName for this individual'),
'type' => 'varchar',
'length' => 255,
'not null' => false,
'default' => '',
),
'FriendlyName' => array(
'description' => t('The FriendlyName for this individual'),
'type' => 'varchar',
'length' => 255,
'not null' => false,
'default' => '',
),
'FamilyPictureUrl' => array(
'description' => t('The FamilyPictureUrl for this individual'),
'type' => 'varchar',
'length' => 255,
'not null' => false,
'default' => '',
),
'DateOfBirth' => array(
'description' => t('The DateOfBirth for this individual'),
'type' => 'varchar',
'length' => 255,
'not null' => false,
'default' => '',
),
'MemberStatus' => array(
'description' => t('The MemberStatus for this individual'),
'type' => 'varchar',
'length' => 255,
'not null' => false,
'default' => '',
),
), ),
'unique keys' => array( 'unique keys' => array(
'IndvId' => array('IndvId') 'IndvId' => array('IndvId')
Expand All @@ -96,7 +131,7 @@ function acs_sync_schema() {
'AddrType' => array( 'AddrType' => array(
'description' => t('The address type'), 'description' => t('The address type'),
'type' => 'varchar', 'type' => 'varchar',
'length' => 32, 'length' => 255,
'not null' => TRUE, 'not null' => TRUE,
'default' => '' 'default' => ''
), ),
Expand All @@ -108,32 +143,32 @@ function acs_sync_schema() {
), ),
'Address2' => array( 'Address2' => array(
'type' => 'varchar', 'type' => 'varchar',
'length' => 32, 'length' => 255,
'not null' => FALSE, 'not null' => false,
'default' => '' 'default' => ''
), ),
'City' => array( 'City' => array(
'type' => 'varchar', 'type' => 'varchar',
'length' => 32, 'length' => 255,
'not null' => FALSE, 'not null' => false,
'default' => '' 'default' => ''
), ),
'Address' => array( 'Address' => array(
'type' => 'varchar', 'type' => 'varchar',
'length' => 32, 'length' => 255,
'not null' => FALSE, 'not null' => false,
'default' => '' 'default' => ''
), ),
'Longitude' => array( 'Longitude' => array(
'type' => 'varchar', 'type' => 'varchar',
'length' => 32, 'length' => 255,
'not null' => FALSE, 'not null' => false,
'default' => '' 'default' => ''
), ),
'State' => array( 'State' => array(
'type' => 'varchar', 'type' => 'varchar',
'length' => 32, 'length' => 255,
'not null' => FALSE, 'not null' => false,
'default' => '' 'default' => ''
), ),
'ActiveAddress' => array( 'ActiveAddress' => array(
Expand All @@ -144,8 +179,8 @@ function acs_sync_schema() {
), ),
'Zipcode' => array( 'Zipcode' => array(
'type' => 'varchar', 'type' => 'varchar',
'length' => 32, 'length' => 255,
'not null' => FALSE, 'not null' => false,
'default' => '' 'default' => ''
), ),
'FamilyAddress' => array( 'FamilyAddress' => array(
Expand All @@ -156,14 +191,14 @@ function acs_sync_schema() {
), ),
'Country' => array( 'Country' => array(
'type' => 'varchar', 'type' => 'varchar',
'length' => 32, 'length' => 255,
'not null' => FALSE, 'not null' => false,
'default' => '' 'default' => ''
), ),
'Company' => array( 'Company' => array(
'type' => 'varchar', 'type' => 'varchar',
'length' => 32, 'length' => 255,
'not null' => FALSE, 'not null' => false,
'default' => '' 'default' => ''
), ),
'StatementAddress' => array( 'StatementAddress' => array(
Expand All @@ -174,20 +209,20 @@ function acs_sync_schema() {
), ),
'Latitude' => array( 'Latitude' => array(
'type' => 'varchar', 'type' => 'varchar',
'length' => 32, 'length' => 255,
'not null' => FALSE, 'not null' => false,
'default' => '' 'default' => ''
), ),
'CityStateZip' => array( 'CityStateZip' => array(
'type' => 'varchar', 'type' => 'varchar',
'length' => 32, 'length' => 255,
'not null' => FALSE, 'not null' => false,
'default' => '' 'default' => ''
), ),
'AddrTypeId' => array( 'AddrTypeId' => array(
'type' => 'int', 'type' => 'int',
'unsigned' => TRUE, 'unsigned' => TRUE,
'not null' => FALSE 'not null' => false
), ),
), ),
'unique keys' => array( 'unique keys' => array(
Expand All @@ -214,12 +249,12 @@ function acs_sync_schema() {
'PhoneTypeId' => array( 'PhoneTypeId' => array(
'type' => 'int', 'type' => 'int',
'unsigned' => TRUE, 'unsigned' => TRUE,
'not null' => FALSE 'not null' => false
), ),
'PhoneRef' => array( 'PhoneRef' => array(
'type' => 'int', 'type' => 'int',
'unsigned' => TRUE, 'unsigned' => TRUE,
'not null' => FALSE 'not null' => false
), ),
'Listed' => array( 'Listed' => array(
'type' => 'int', 'type' => 'int',
Expand All @@ -229,7 +264,7 @@ function acs_sync_schema() {
), ),
'PhoneNumber' => array( 'PhoneNumber' => array(
'type' => 'varchar', 'type' => 'varchar',
'length' => 32, 'length' => 255,
'not null' => TRUE, 'not null' => TRUE,
'default' => '' 'default' => ''
), ),
Expand All @@ -253,14 +288,14 @@ function acs_sync_schema() {
), ),
'Extension' => array( 'Extension' => array(
'type' => 'varchar', 'type' => 'varchar',
'length' => 32, 'length' => 255,
'not null' => FALSE, 'not null' => false,
'default' => '' 'default' => ''
), ),
'PhoneType' => array( 'PhoneType' => array(
'type' => 'varchar', 'type' => 'varchar',
'length' => 32, 'length' => 255,
'not null' => FALSE, 'not null' => false,
'default' => '' 'default' => ''
), ),
), ),
Expand Down Expand Up @@ -299,14 +334,14 @@ function acs_sync_schema() {
), ),
'EmailType' => array( 'EmailType' => array(
'type' => 'varchar', 'type' => 'varchar',
'length' => 32, 'length' => 255,
'not null' => FALSE, 'not null' => false,
'default' => '' 'default' => ''
), ),
'Email' => array( 'Email' => array(
'type' => 'varchar', 'type' => 'varchar',
'length' => 32, 'length' => 255,
'not null' => FALSE, 'not null' => false,
'default' => '' 'default' => ''
), ),
), ),
Expand Down
6 changes: 6 additions & 0 deletions ACSSync.module
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ function acssync_sync()
return; return;
} }


foreach ($result->Page as $simple_person) {
$individual = $acsAPI->get_person($simple_person->IndvId);
var_dump($individual);
return;
}

// $query = db_insert('accessacs_individuals') // $query = db_insert('accessacs_individuals')
// ->fields(array( // ->fields(array(
// 'IndvId', // 'IndvId',
Expand Down

0 comments on commit a61841c

Please sign in to comment.