Matcher
in package
Classify an incoming cartridge resource against existing cc_object rows.
Duplicate is origin plus fingerprint: same resource id and type, stored hash still matches, and the local object has not diverged. Identifier match alone is ancestry (copy), not a skip.
Table of Contents
Constants
- ACTION_COPY : mixed = 'copy'
- ACTION_CREATED : mixed = 'created'
- ACTION_DUPLICATE : mixed = 'duplicate'
- ACTION_ERROR : mixed = 'error'
- ACTION_SKIPPED : mixed = 'skipped'
- COPY : mixed = 'copy'
- DUPLICATE : mixed = 'duplicate'
- NEW : mixed = 'new'
- STATUS_FAIL : mixed = 'fail'
- STATUS_OK : mixed = 'ok'
- STATUS_PARTIAL : mixed = 'partial'
- STATUS_RUNNING : mixed = 'running'
- TYPE_LTI : mixed = 'imsbasiclti_xmlv1p0'
- TYPE_QTI : mixed = 'imsqti_xmlv1p2'
- TYPE_TOPIC : mixed = 'imsdt_xmlv1p1'
- TYPE_WEBCONTENT : mixed = 'webcontent'
- TYPE_WEBLINK : mixed = 'imswl_xmlv1p1'
Methods
- classify() : array{action: string, object: ?array}
- logAction() : string
- Log action written for a classify result (new becomes created).
Constants
ACTION_COPY
public
mixed
ACTION_COPY
= 'copy'
ACTION_CREATED
public
mixed
ACTION_CREATED
= 'created'
ACTION_DUPLICATE
public
mixed
ACTION_DUPLICATE
= 'duplicate'
ACTION_ERROR
public
mixed
ACTION_ERROR
= 'error'
ACTION_SKIPPED
public
mixed
ACTION_SKIPPED
= 'skipped'
COPY
public
mixed
COPY
= 'copy'
DUPLICATE
public
mixed
DUPLICATE
= 'duplicate'
NEW
public
mixed
NEW
= 'new'
STATUS_FAIL
public
mixed
STATUS_FAIL
= 'fail'
STATUS_OK
public
mixed
STATUS_OK
= 'ok'
STATUS_PARTIAL
public
mixed
STATUS_PARTIAL
= 'partial'
STATUS_RUNNING
public
mixed
STATUS_RUNNING
= 'running'
TYPE_LTI
public
mixed
TYPE_LTI
= 'imsbasiclti_xmlv1p0'
TYPE_QTI
public
mixed
TYPE_QTI
= 'imsqti_xmlv1p2'
TYPE_TOPIC
public
mixed
TYPE_TOPIC
= 'imsdt_xmlv1p1'
TYPE_WEBCONTENT
public
mixed
TYPE_WEBCONTENT
= 'webcontent'
TYPE_WEBLINK
public
mixed
TYPE_WEBLINK
= 'imswl_xmlv1p1'
Methods
classify()
public
static classify(array<int, array<string, mixed>> $objects, string $resourceIdentifier, string $resourceType, string $contentHash) : array{action: string, object: ?array}
Parameters
- $objects : array<int, array<string, mixed>>
-
Rows already in this context
- $resourceIdentifier : string
-
Incoming <resource identifier>
- $resourceType : string
-
Incoming resource type
- $contentHash : string
-
Canonical fingerprint of incoming content
Return values
array{action: string, object: ?array}logAction()
Log action written for a classify result (new becomes created).
public
static logAction(string $classifyAction) : string
Parameters
- $classifyAction : string