SilverCommerce\ContactAdmin\Helpers\ContactHelper
Synopsis
class ContactHelper
{
- // members
- private static string $common_field = "Email";
- private static array $sync_fields = ;
- private static boolean $auto_sync = true;
- private static array $default_user_groups = ;
- private Contact $contact;
- private Member $member;
- // methods
- public Member findOrMakeMember()
- public Contact findOrMakeContact()
- public void syncContactAndMember()
- public static array pushChangedFields()
- public static array pushFields()
- public int linkMemberToGroups()
- public Contact getContact()
- public ContactHelper setContact()
- public Member getMember()
- public ContactHelper setMember()
Hierarchy
Uses
- SilverStripe\Core\Injector\Injectable
- SilverStripe\Core\Config\Configurable
Tasks
Line | Task |
---|---|
157+ | Currently sync is pretty basic (pushes data from one object to another). This could be more intilligent. |
Members
private
- $auto_sync
—
boolean
Automatically sync users and contacts on save and auto create contacts for existing users - $common_field
—
string
The field that is shared between Members and Contacts. - $contact — SilverCommerce\ContactAdmin\Model\Contact
- $default_user_groups
—
array
Add codes for default groups linked user accounts are added to - $member — SilverStripe\Security\Member
- $sync_fields
—
array
Fields that can be synced between members and contacts
Methods
public
- findOrMakeContact() — Find or create a Contact from the provided member
- findOrMakeMember() — Create a member from the provided contact
- getContact() — Get the value of contact. If not assigned directly, try to get from the member
- getMember() — Get the value of member. If not assigned directly, try to get from Contact
- linkMemberToGroups() — Link the set member to all the groups specified via config
- pushChangedFields() — Push any fields relevent fields changed on the origin obvject, to the destination, if the destination is different.
- pushFields() — Push the field values from the origin object and the destination object (if values do not match)
- setContact() — Set the value of contact
- setMember() — Set the value of member
- syncContactAndMember() — Update an associated member with the data from this contact