L_OK = 0
This class represents an Identity Provider (IdP).
IdPs have properties of their own, and may have one or more Profiles. The profiles can override the institution-wide properties.
$attributes : mixed|string|int
This variable gets initialised with the known IdP attributes in the constructor. It never gets updated until the object is destroyed. So if attributes change in the database, and IdP attributes are to be queried afterwards, the object needs to be re-instantiated to have current values in this variable.
getAttributes( optionName = NULL) : mixed|string|int
This function retrieves the entity's attributes.
If called with the optional parameter, only attribute values for the attribute name in $optionName are retrieved; otherwise, all attributes are retrieved. The retrieval is in-memory from the internal attributes class member - no DB callback, so changes in the database during the class instance lifetime are not considered.
optionally, the name of the attribute that is to be retrieved
of arrays of attributes which were set for this IdP
getAttributeValue(mixed|string|int attributeArray, string|int index1, string|int index2) : \core\any
This is a helper fuction to retreave a value from two-dimmentional arrays The function tests if the value for the first indes is defined and then the same with the second and finally returns the value if something on the way is not defined, NULL is returned
value or NULL
addAttribute( attrName, attrLang, attrValue)
Adds an attribute for the entity instance into the database. Multiple instances of the same attribute are supported.
Name of the attribute. This must be a well-known value from the profile_option_dict table in the DB.
language of the attribute. Can be NULL.
Value of the attribute. Can be anything; will be stored in the DB as-is.
fetchRawDataByIndex( table, row) : string|bool
Retrieves data from the underlying tables, for situations where instantiating the IdP or Profile object is inappropriate
institution_option or profile_option
the data, or FALSE if something went wrong
isDataRestricted( table, row) :
Checks if a raw data pointer is public data (return value FALSE) or if yes who the authorised admins to view it are (return array of user IDs)
which database table is this about
row index of the table
FALSE if the data is public, an array of owners of the data if it is NOT public
This function sets the timestamp of last modification of the child profiles to the current timestamp.
This is needed for installer caching: all installers which are on disk must be re-created if an attribute changes. This timestamp here is used to determine if the installer on disk is still new enough.
createTemporaryDirectory( purpose = installer, failIsFatal = 1) : mixed|string|int
create a temporary directory and return the location
one of 'installer', 'logo', 'test' defined the purpose of the directory
decides if a creation failure should cause an error; defaults to true
the tuple of: base path, absolute path for directory, directory name
listProfiles( activeOnly = FALSE) : mixed|string|int
This function retrieves all registered profiles for this IdP from the database
if and set to non-zero will cause listing of only those institutions which have some valid profiles defined.
list of Profiles of this IdP
newProfile( type) :
Adds a new profile to this IdP.
Only creates the DB entry for the Profile. If you want to add attributes later, see Profile::addAttribute().
exactly "RADIUS" or "SILVERBULLET", all other values throw an Exception
new Profile object if successful, or FALSE if an error occured
Performs a lookup in an external database to determine matching entities to this IdP.
The business logic of this function is roaming consortium specific; if no match algorithm is known for the consortium, FALSE is returned.
list of entities in external database that correspond to this IdP or FALSE if no consortium-specific matching function is defined
retrieveOptionsFromDatabase( query, level) : mixed|string|int
retrieve attributes from a database. Only does SELECT queries.
sub-classes set the query to execute to get to the options
the retrieved options get flagged with this "level" identifier
the attributes in one array