My question relates to the Tin Can PHP API library's Person
object and what use may be made of it.
The library's Person
object is (so far as I understand) an implementation of the Agents Resource in Part 3 Section 2.4 of the xAPI specification (link: https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Communication.md#24-agents-resource). The specification recognises a Person object and indicates that the purpose of the object is to
provide combined information about an Agent derived from an outside service, such as a directory service
It seems from that description, and from the developers of the library (see link), that the specification's Person object is intended to provide a means of collecting, within the one object, information about a person which is dispersed among a number of different Agent objects.
I have had difficulty following the examples in the library but the following (oversimplified) code seems to work in the SCORM Cloud LRS:
...
$agent1 = new TinCan\Agent();
$agent1
->setMbox('david.jones@somehospital.gov.au')
->setName('Dr David Jones');
$agent2 = new TinCan\Agent();
$agent2
->setMbox('d.jones@medicalorg.org.au')
->setName('David Jones');
$person = new TinCan\Person();
$person
->setMbox([$agent1->getMbox(), $agent2->getMbox()])
->setName([$agent1->getName(), $agent2->getName()]);
...
Is the library's Person
object intended to be saved to the LRS? If so I have not been able to find any means of doing so using the library's Statement
object. If not, what is its intended use?
I would be grateful for clarification. Thank you.