userUri = isset($data[self::USER_IDENTIFIER]) ? $data[self::USER_IDENTIFIER] : null; $this->taoRoles = isset($data[GenerisRdf::PROPERTY_USER_ROLES]) ? $data[GenerisRdf::PROPERTY_USER_ROLES] : []; $this->language = isset($data[GenerisRdf::PROPERTY_USER_UILG]) ? $data[GenerisRdf::PROPERTY_USER_UILG] : null; $this->label = isset($data[OntologyRdfs::RDFS_LABEL]) ? $data[OntologyRdfs::RDFS_LABEL] : null; $this->firstname = isset($data[GenerisRdf::PROPERTY_USER_FIRSTNAME]) ? $data[GenerisRdf::PROPERTY_USER_FIRSTNAME] : null; $this->lastname = isset($data[GenerisRdf::PROPERTY_USER_LASTNAME]) ? $data[GenerisRdf::PROPERTY_USER_LASTNAME] : null; $this->email = isset($data[GenerisRdf::PROPERTY_USER_MAIL]) ? $data[GenerisRdf::PROPERTY_USER_MAIL] : null; } /** * (non-PHPdoc) * @see \common_user_User::getIdentifier() */ public function getIdentifier() { return $this->userUri; } public function setIdentifier($userId) { $this->userUri = $userId; } /** * (non-PHPdoc) * @see \common_user_User::getPropertyValues() */ public function getPropertyValues($property) { $returnValue = null; switch ($property) { case GenerisRdf::PROPERTY_USER_DEFLG: $returnValue = [DEFAULT_LANG]; break; case GenerisRdf::PROPERTY_USER_UILG: $returnValue = [new \core_kernel_classes_Literal($this->language)]; break; case GenerisRdf::PROPERTY_USER_ROLES: $returnValue = $this->taoRoles; break; case GenerisRdf::PROPERTY_USER_FIRSTNAME: $returnValue = [new \core_kernel_classes_Literal($this->firstname)]; break; case GenerisRdf::PROPERTY_USER_LASTNAME: $returnValue = [new \core_kernel_classes_Literal($this->lastname)]; break; case OntologyRdfs::RDFS_LABEL: $returnValue = [new \core_kernel_classes_Literal($this->label)]; break; case GenerisRdf::PROPERTY_USER_MAIL: $returnValue = [new \core_kernel_classes_Literal($this->email)]; break; default: \common_Logger::d('Unkown property ' . $property . ' requested from ' . __CLASS__); $returnValue = []; } return $returnValue; } /** * @param $properties * @return array */ public function getPropertiesValues($properties) { $returnValues = []; foreach ($properties as $property) { $returnValues[$property] = $this->getPropertyValues($property); } return $returnValues; } /** * (non-PHPdoc) * @see \common_user_User::refresh() */ public function refresh() { // nothing to do } /** * @return array */ public function jsonSerialize() { return [ self::USER_IDENTIFIER => $this->userUri, GenerisRdf::PROPERTY_USER_ROLES => $this->taoRoles, GenerisRdf::PROPERTY_USER_UILG => $this->language, GenerisRdf::PROPERTY_USER_FIRSTNAME => $this->firstname, GenerisRdf::PROPERTY_USER_LASTNAME => $this->lastname, GenerisRdf::PROPERTY_USER_MAIL => $this->email, OntologyRdfs::RDFS_LABEL => $this->label, ]; } }