Documentation

CRM_Member_Import_Parser_Membership extends CRM_Import_Parser
in package

class to parse membership csv files

Table of Contents

Properties

$_fileName  : mixed
$_fileSize  : int
Imported file size
$_newMemberships  : array<string|int, mixed>
Array of successfully imported membership id's
$_separator  : string
Separator being used
$fieldMetadata  : array<string|int, mixed>
Array of metadata for all available fields.

Methods

formattedDates()  : mixed
to calculate join, start and end dates
getImportEntities()  : array<string|int, mixed>
Get a list of entities this import supports.
getUserJobInfo()  : array<string|int, mixed>
Get information about the provided job.
import()  : int|void|null
Handle the values in import mode.
validateValues()  : void
Validate the values.
getImportableFields()  : array<string|int, mixed>|mixed
getOddlyMappedMetadataFields()  : array<string|int, string>
Get the metadata field for which importable fields does not key the actual field name.
setFieldMetadata()  : void
Set field metadata.

Properties

$_fileSize

Imported file size

protected int $_fileSize

$_newMemberships

Array of successfully imported membership id's

protected array<string|int, mixed> $_newMemberships

$_separator

Separator being used

protected string $_separator

$fieldMetadata

Array of metadata for all available fields.

protected array<string|int, mixed> $fieldMetadata = []

Methods

formattedDates()

to calculate join, start and end dates

public formattedDates(array<string|int, mixed> $calcDates, mixed &$formatted) : mixed
Parameters
$calcDates : array<string|int, mixed>

Array of dates returned by getDatesForMembershipType().

$formatted : mixed

getImportEntities()

Get a list of entities this import supports.

public getImportEntities() : array<string|int, mixed>
Return values
array<string|int, mixed>

getUserJobInfo()

Get information about the provided job.

public static getUserJobInfo() : array<string|int, mixed>
  • name
  • id (generally the same as name)
  • label

e.g. ['activity_import' => ['id' => 'activity_import', 'label' => ts('Activity Import'), 'name' => 'activity_import']]

Return values
array<string|int, mixed>

import()

Handle the values in import mode.

public import(array<string|int, mixed> $values) : int|void|null
Parameters
$values : array<string|int, mixed>

The array of values belonging to this line.

Return values
int|void|null

the result of this processing - which is ignored

validateValues()

Validate the values.

public validateValues(array<string|int, mixed> $values) : void
Parameters
$values : array<string|int, mixed>

The array of values belonging to this line.

Tags
throws
CRM_Core_Exception

getImportableFields()

protected getImportableFields([string $contactType = 'Individual' ]) : array<string|int, mixed>|mixed
Parameters
$contactType : string = 'Individual'
Tags
throws
CRM_Core_Exception
Return values
array<string|int, mixed>|mixed

getOddlyMappedMetadataFields()

Get the metadata field for which importable fields does not key the actual field name.

protected getOddlyMappedMetadataFields() : array<string|int, string>
Return values
array<string|int, string>

setFieldMetadata()

Set field metadata.

protected setFieldMetadata() : void

        
On this page

Search results