rapidwebltd / php-google-contacts-v3-api

👥 PHP library for the Google Contacts API (v3)
MIT License
102 stars 64 forks source link

Add firstname, lastname, company #39

Open ShaiMagal opened 7 years ago

ShaiMagal commented 7 years ago

Hello,

can you add support for firstname, lastname and company?

Thank you.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/45420506-add-firstname-lastname-company?utm_campaign=plugin&utm_content=tracker%2F19518826&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F19518826&utm_medium=issues&utm_source=github).
EmilieTreuil commented 3 years ago

You can add firstname and lastname in the public static function create in ContactFactory.php

with this code :

$Name = $doc->createElement('gd:name'); $Name->setAttribute('gd:familyName', $familyName); Name->setAttribute('gd:givenName', $givenName); $Name->setAttribute('gd:fullName', $givenName . ' ' . $familyName); #full Name

This work the same for the company :

$job = $doc->createElement('gd:organization'); $job->setAttribute('gd:orgName', $company); $job->setAttribute('gd:orgTitle', $employment); $job->setAttribute('gd:orgDepartment', $department); $entry->appendChild($job);

don't forget to add the variables in the function and care the function Submitupdate doesn't really work after that... i work on it but i'm just a student so kind of hard to fully understand for me.