class CRM_Contact_Page_View_Relationship extends CRM_Core_Page

Traits

Properties

protected string $_name The name of the page (auto generated from class name) from CRM_Core_Page
protected object $_title The title associated with this page. from CRM_Core_Page
protected int $_mode A page can have multiple modes. (i.e. displays a different set of data based on the input from CRM_Core_Page
protected bool $_embedded Is this object being embedded in another object. If so the display routine needs to not do any work. (The parent object takes care of the display) from CRM_Core_Page
protected bool $_print Are we in print mode? if so we need to modify the display functionality to do a minimal display :) from CRM_Core_Page
static protected CRM_Core_Smarty $_template Cache the smarty template for efficiency reasons from CRM_Core_Page
static protected CRM_Core_Session $_session Cache the session for efficiency reasons from CRM_Core_Page
array $ajaxResponse What to return to the client if in ajax mode (snippet=json) from CRM_Core_Page
array $urlPath Url path used to reach this page from CRM_Core_Page
bool $useLivePageJS Should crm.livePage.js be added to the page? from CRM_Core_Page
protected int $_id The id of the contact. from CRM_Core_Page_EntityPageTrait
protected int $_action The mode of operation for this page from CRM_Core_Page_EntityPageTrait
protected string $_context The context that we are working on. from CRM_Core_Page_EntityPageTrait
int $_contactID Contact ID of the contact on the page. from CRM_Core_Page_EntityPageTrait
int $_contactId Contact ID of the contact on the page. from CRM_Core_Page_EntityPageTrait
int $_permission from CRM_Core_Page_EntityPageTrait
$_links The action links that we need to display for the browse screen. from CRM_Core_Page_EntityPageTrait
int $_caseId Casid set if called from case context.

Methods

__construct(string $title = NULL, int $mode = NULL)

Class constructor.

run()

the main function that is called when the page loads, it decides the which action has to be taken for the page.

set(string|array $name, mixed $value = NULL)

Store the variable with the value in the form scope.

mixed
get(string $name)

Get the variable from the form scope.

assign(string $var, mixed $value = NULL)

Assign value to name in template.

assign_by_ref(string $var, mixed $value)

Assign value to name in template by reference.

append(array|string $tpl_var, mixed $value = NULL, bool $merge = FALSE)

Appends values to template variables.

array
get_template_vars(string $name = NULL)

Returns an array containing template variables.

reset()

Destroy all the session state of this page.

string
getTemplateFileName()

Use the form name to create the tpl file name.

getHookedTemplateFileName()

A wrapper for getTemplateFileName that includes calling the hook to prevent us from having to copy & paste the logic of calling the hook

string
overrideExtraTemplateFileName()

Default extra tpl file basically just replaces .tpl with .extra.tpl i.e. we dont override

setEmbedded(bool $embedded)

Setter for embedded.

bool
getEmbedded()

Getter for embedded.

setPrint(bool $print)

Setter for print.

bool
getPrint()

Getter for print.

static CRM_Core_Smarty
getTemplate()

No description

null
getVar(string $name)

No description

setVar(string $name, $value)

No description

assignFieldMetadataToTemplate(string $entity)

Assign metadata about fields to the template.

int|null
getEntityId()

Get the entity id being edited.

string
getContext()

Get the context we are working in

int
getContactId()

Get the contact ID

setContactId($contactId)

Set the contact ID

getAction()

No description

string|null
getDefaultContext()

Explicitly declare the form context.

bool
isDeleteContext()

Is the form being used in the context of a deletion.

bool
isViewContext()

Is the form being used in the context of a view.

bool
isEditContext()

Is the form being used in the context of a edit.

setCaseId(int $caseId)

No description

int
getCaseId()

No description

string
getDefaultEntity()

Explicitly declare the entity api name.

view()

View details of a relationship.

browse()

called when action is browse.

edit()

called when action is update or new.

setContext()

No description

delete()

called to delete the relationship of a contact.

static array
links()

Get action links.

Details

in CRM_Core_Page at line 126
CRM_Core_Page __construct(string $title = NULL, int $mode = NULL)

Class constructor.

Parameters

string $title Title of the page.
int $mode Mode of the page.

Return Value

CRM_Core_Page

at line 214
run()

the main function that is called when the page loads, it decides the which action has to be taken for the page.

Exceptions

CRM_Core_Exception

in CRM_Core_Page at line 249
set(string|array $name, mixed $value = NULL)

Store the variable with the value in the form scope.

Parameters

string|array $name name of the variable or an assoc array of name/value pairs
mixed $value Value of the variable if string.

in CRM_Core_Page at line 260
mixed get(string $name)

Get the variable from the form scope.

Parameters

string $name name of the variable

Return Value

mixed

in CRM_Core_Page at line 271
assign(string $var, mixed $value = NULL)

Assign value to name in template.

Parameters

string $var
mixed $value Value of variable.

in CRM_Core_Page at line 282
assign_by_ref(string $var, mixed $value)

Assign value to name in template by reference.

Parameters

string $var
mixed $value (reference) value of variable.

in CRM_Core_Page at line 294
append(array|string $tpl_var, mixed $value = NULL, bool $merge = FALSE)

Appends values to template variables.

Parameters

array|string $tpl_var the template variable name(s)
mixed $value The value to append.
bool $merge

in CRM_Core_Page at line 305
array get_template_vars(string $name = NULL)

Returns an array containing template variables.

Parameters

string $name

Return Value

array

in CRM_Core_Page at line 312
reset()

Destroy all the session state of this page.

in CRM_Core_Page at line 321
string getTemplateFileName()

Use the form name to create the tpl file name.

Return Value

string

in CRM_Core_Page at line 335
getHookedTemplateFileName()

A wrapper for getTemplateFileName that includes calling the hook to prevent us from having to copy & paste the logic of calling the hook

in CRM_Core_Page at line 347
string overrideExtraTemplateFileName()

Default extra tpl file basically just replaces .tpl with .extra.tpl i.e. we dont override

Return Value

string

in CRM_Core_Page at line 356
setEmbedded(bool $embedded)

Setter for embedded.

Parameters

bool $embedded

in CRM_Core_Page at line 366
bool getEmbedded()

Getter for embedded.

Return Value

bool return the embedded value

in CRM_Core_Page at line 375
setPrint(bool $print)

Setter for print.

Parameters

bool $print

in CRM_Core_Page at line 385
bool getPrint()

Getter for print.

Return Value

bool return the print value

in CRM_Core_Page at line 392
static CRM_Core_Smarty getTemplate()

Return Value

CRM_Core_Smarty

in CRM_Core_Page at line 401
null getVar(string $name)

Parameters

string $name

Return Value

null

in CRM_Core_Page at line 409
setVar(string $name, $value)

Parameters

string $name
$value

in CRM_Core_Page at line 426
protected assignFieldMetadataToTemplate(string $entity)

Assign metadata about fields to the template.

In order to allow the template to format fields we assign information about them to the template.

At this stage only date field metadata is assigned as that is the only use-case in play and we don't want to assign a lot of unneeded data.

Parameters

string $entity The entity being queried.

Exceptions

CiviCRM_API3_Exception

int|null getEntityId()

Get the entity id being edited.

Return Value

int|null

string getContext()

Get the context we are working in

Return Value

string

int getContactId()

Get the contact ID

Return Value

int

setContactId($contactId)

Set the contact ID

Parameters

$contactId

getAction()

at line 72
string|null getDefaultContext()

Explicitly declare the form context.

Return Value

string|null

preProcessQuickEntityPage()

protected bool isDeleteContext()

Is the form being used in the context of a deletion.

(For some reason rather than having separate forms Civi overloads one form).

Return Value

bool

protected bool isViewContext()

Is the form being used in the context of a view.

Return Value

bool

protected bool isEditContext()

Is the form being used in the context of a edit.

Return Value

bool

at line 47
setCaseId(int $caseId)

Parameters

int $caseId

at line 54
int getCaseId()

Return Value

int

at line 63
string getDefaultEntity()

Explicitly declare the entity api name.

Return Value

string

at line 79
view()

View details of a relationship.

at line 159
browse()

called when action is browse.

at line 171
edit()

called when action is update or new.

at line 236
setContext()

at line 251
delete()

called to delete the relationship of a contact.

Get action links.

Return Value

array (reference) of action links