SilverCommerce\ContactAdmin\Model\Contact
Details on a particular contact
- Author: ilateral
Synopsis
class Contact
extends DataObject
implements
PermissionProvider
{
- // constants
- const LOCATION_BY_POS = 'LocationByPos';
- const PERMISSION_MANAGE = 'CONTACTS_MANAGE';
- const PERMISSION_CREATE = 'CONTACTS_CREATE';
- const PERMISSION_VIEW = 'CONTACTS_VIEW';
- const PERMISSION_EDIT = 'CONTACTS_EDIT';
- const PERMISSION_DELETE = 'CONTACTS_DELETE';
- // members
- private static string $table_name = 'Contact';
- private static string $list_seperator = ", ";
- private static array $db = ;
- private static array $has_one = ;
- private static array $has_many = ;
- private static array $many_many = ;
- private static array $belongs_many_many = ;
- private static array $casting = ;
- private static array $field_labels = ;
- private static array $summary_fields = ;
- private static array $searchable_fields = ;
- private static array $export_fields = ;
- private static array $default_sort = ;
- private static array $extensions = ;
- private static array $versioning = ;
- // methods
- public void getTitle()
- public void getFullName()
- public void getFlaggedNice()
- public static self|null getByMostLocations()
- public ContactLocation DefaultLocation()
- public string getDefaultAddress()
- public string getName()
- public string getTagsList()
- public string getListsList()
- public void getFlagged()
- public ContactSearchContext getDefaultSearchContext()
- public ContactSearchContext getModelAdminSearchContext()
- public void getCMSFields()
- public void getCMSValidator()
- public array getExportFields()
- public mixed relField()
- public void providePermissions()
- public void canView()
- public void canCreate()
- public void canEdit()
- public void canDelete()
- public void onAfterWrite()
- public void onBeforeDelete()
Hierarchy
Extends
- SilverStripe\ORM\DataObject
Implements
- SilverStripe\Security\PermissionProvider
Tasks
Line | Task |
---|---|
534 | This is a bit in-effitient, woud be nice to do this with slightly less queries |
Constants
Name | Value |
---|---|
LOCATION_BY_POS | 'LocationByPos' |
PERMISSION_MANAGE | 'CONTACTS_MANAGE' |
PERMISSION_CREATE | 'CONTACTS_CREATE' |
PERMISSION_VIEW | 'CONTACTS_VIEW' |
PERMISSION_EDIT | 'CONTACTS_EDIT' |
PERMISSION_DELETE | 'CONTACTS_DELETE' |
Members
private
- $belongs_many_many
- $casting
- $db
- $default_sort
- $export_fields
- $extensions
—
array
Add extension classes - $field_labels
- $has_many
- $has_one
- $list_seperator
—
string
String used to seperate tags, lists, etc when rendering a summary. - $many_many
- $searchable_fields
- $summary_fields
- $table_name
- $versioning
—
array
Declare version history
Methods
public
- DefaultLocation() — Find from our locations one marked as default (of if not the first in the list).
- canCreate()
- canDelete()
- canEdit()
- canView()
- getByMostLocations() — Get a contact with the most locations assigned
- getCMSFields()
- getCMSValidator()
- getDefaultAddress() — Find from our locations one marked as default (of if not the first in the list).
- getDefaultSearchContext() — Load custom search context to allow for filtering by flagged notes
- getExportFields() — Get the default export fields for this object
- getFlagged()
- getFlaggedNice()
- getFullName()
- getListsList() — Generate as string of list titles seperated by a comma
- getModelAdminSearchContext() — Load custom search context for model admin plus
- getName() — Get the complete name of the member
- getTagsList() — Generate as string of tag titles seperated by a comma
- getTitle()
- onAfterWrite() — Sync to associated member (if needed)
- onBeforeDelete() — Cleanup DB on removal
- providePermissions()
- relField() — Check field