summaryrefslogtreecommitdiff
path: root/includes/classes/ContactPerson.php
blob: 5393355f071f4dab260965cd870dce91ab2ad93e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
/**
 * Person contact — extends Contact with content_type_guid='contactperson'.
 *
 * Person-specific xref items ($00 type etc.) are registered at the 'contactperson'
 * level; shared contact fields (addresses, SCREF etc.) live at the 'contact'
 * package level and are picked up via the dual-guid xref pattern.
 *
 * @package contact
 */
namespace Bitweaver\Contact;

class ContactPerson extends Contact {

	public function __construct( $pContactId = NULL, $pContentId = NULL ) {
		parent::__construct( $pContactId, $pContentId );
		$this->mContentTypeGuid = CONTACTPERSON_CONTENT_TYPE_GUID;
		$this->registerContentType( CONTACTPERSON_CONTENT_TYPE_GUID, [
			'content_type_guid' => CONTACTPERSON_CONTENT_TYPE_GUID,
			'content_name'      => 'Person Contact',
			'handler_class'     => 'ContactPerson',
			'handler_package'   => 'contact',
			'handler_file'      => 'ContactPerson.php',
			'maintainer_url'    => 'http://lsces.co.uk',
		] );
		// mPackageGuid='contact' is set automatically by registerContentType()
		// because handler_package('contact') != content_type_guid('contactperson').
	}
}