44 private $resourceLink =
null;
51 private $resourceLinkId =
null;
65 private $dataConnector =
null;
81 $this->ltiResultSourcedId =
null;
82 $this->created =
null;
83 $this->updated =
null;
93 if (!empty($this->ltiResultSourcedId) && !is_null($this->resourceLinkId)) {
107 public function delete()
121 if (is_null($this->resourceLink) && !is_null($this->resourceLinkId)) {
125 return $this->resourceLink;
135 $this->resourceLink = $resourceLink;
165 $this->resourceLinkId = $resourceLinkId;
175 return $this->dataConnector;
185 $this->dataConnector = $dataConnector;
195 public function getId($idScope =
null)
197 if (empty($idScope)) {
198 if (!is_null($this->resourceLink)) {
199 $idScope = $this->resourceLink->getConsumer()->idScope;
210 if ($this->resourceLink->ltiContextId) {
217 if ($this->resourceLink->ltiResourceLinkId) {
241 $userresult->dataConnector = $dataConnector;
242 $userresult->load($id);
258 $userresult->resourceLink = $resourceLink;
259 if (!is_null($resourceLink)) {
260 $userresult->resourceLinkId = $resourceLink->getRecordId();
261 $userresult->dataConnector = $resourceLink->getDataConnector();
282 private function load($id =
null)
287 if (!is_null($dataConnector)) {
288 return $dataConnector->loadUserResult($this);
getRecordId()
Get record ID of user.
static fromResourceLink($resourceLink, $ltiUserId)
Class constructor from resource link.
$ltiResultSourcedId
UserResult's result sourcedid.
$ltiUserId
user ID as supplied in the last connection request.
$created
Date/time the record was created.
initialize()
Initialise the user.
setResourceLink($resourceLink)
Set resource link.
getResourceLink()
Get resource link.
static fromRecordId($id, $dataConnector)
Load the user from the database.
__construct()
Class constructor.
$updated
Date/time the record was last updated.
getId($idScope=null)
Get the user ID (which may be a compound of the tool consumer and resource link IDs).
Class to represent a tool consumer user.
save()
Save the user to the database.
static fromRecordId($id, $dataConnector)
Load the resource link from the database.
setResourceLinkId($resourceLinkId)
Set resource link ID of user.
setRecordId($id)
Set record ID of user.
Class to represent a tool consumer user.
getDataConnector()
Get the data connector.
setDataConnector($dataConnector)
Set the data connector.