CWIS Developer Documentation
|
Represents a "resource" in CWIS. More...
Public Member Functions | |
__construct ($ResourceId) | |
Object constructor for loading an existing resource. More... | |
Delete () | |
Remove resource (and accompanying associations) from database and delete any associated files. More... | |
UpdateAutoupdateFields ($UpdateType, $User=NULL) | |
Update the auto-updated fields as necessary. More... | |
Id () | |
Retrieve numerical resource ID. More... | |
SchemaId () | |
Retrieve ID of schema for resource. More... | |
Schema () | |
Get MetadataSchema for resource. More... | |
IsTempResource ($NewSetting=NULL) | |
Get/set whether resource is a temporary record. More... | |
GetViewPageUrl () | |
Retrieve view page URL for this resource. More... | |
Get ($Field, $ReturnObject=FALSE, $IncludeVariants=FALSE) | |
Retrieve value using field name or field object. More... | |
GetForDisplay ($FieldNameOrObject, $ReturnObject=TRUE, $IncludeVariants=FALSE) | |
Retrieve value using field name or field object, signaling EVENT_FIELD_DISPLAY_FILTER to allow other code to possibly modify the value before it's returned. More... | |
GetByField ($FieldNameOrObject, $ReturnObject=FALSE, $IncludeVariants=FALSE) | |
Old method for retrieving values, deprecated in favor of Get(). More... | |
GetByFieldId ($FieldId, $ReturnObject=FALSE, $IncludeVariants=FALSE) | |
Retrieve value using field ID. More... | |
GetAsArray ($IncludeDisabledFields=FALSE, $ReturnObjects=TRUE) | |
Retrieve all resource values as an array. More... | |
GetMapped ($MappedName, $ReturnObject=FALSE, $IncludeVariants=FALSE) | |
Retrieve value using standard (mapped) field name. More... | |
GetQualifier ($FieldName, $ReturnObject=TRUE) | |
Retrieve qualifier by field name. More... | |
GetQualifierByFieldId ($FieldId, $ReturnObject=TRUE) | |
Retrieve qualifier by field ID. More... | |
GetQualifierByField ($Field, $ReturnObject=TRUE) | |
Retrieve qualifier by Field object. More... | |
FieldIsSet ($FieldNameOrObject, $IgnorePadding=FALSE) | |
Determine if the value for a field is set. More... | |
GetImageUrls ($FieldNameOrObject, $ImageSize=SPTImage::SIZE_FULL) | |
Get URLs for images, returning CleanURLs when possible and direct paths to image files otherwise. More... | |
Set ($Field, $NewValue, $Reset=FALSE) | |
Set value using field name or field object. More... | |
SetByField ($Field, $NewValue) | |
Method replaced by Resource::Set(), preserved for backward compatibility. More... | |
SetByFieldId ($FieldId, $NewValue) | |
Set field value using field ID. More... | |
SetQualifier ($FieldName, $NewValue) | |
Set qualifier using field name. More... | |
SetQualifierByFieldId ($FieldId, $NewValue) | |
Set qualifier using field ID. More... | |
SetQualifierByField ($Field, $NewValue) | |
Set qualifier using field object. More... | |
ClearByFieldId ($FieldId, $ValueToClear=NULL) | |
Clear field value specified by field ID. More... | |
Clear ($Field, $ValueToClear=NULL) | |
Clear field value. More... | |
ClearByField ($Field, $ValueToClear=NULL) | |
Clear field value. More... | |
Classifications () | |
Get 2D array of classifications associated with resource. More... | |
CumulativeRating () | |
Get cumulative rating (range is usually 0-100) More... | |
ScaledCumulativeRating () | |
Return cumulative rating scaled to 1/10th. More... | |
NumberOfRatings () | |
Get current number of ratings for resource. More... | |
Rating ($NewRating=NULL, $UserId=NULL) | |
Get/set rating by a specific user for resource. More... | |
Comments () | |
Get comments for resource. More... | |
NumberOfComments () | |
Get current number of comments for resource. More... | |
UserCanView (User $User, $AllowHooksToModify=TRUE) | |
Determine if the given user can view the resource, e.g., on the full record page. More... | |
UserCanEdit ($User) | |
Determine if the given user can edit the resource. More... | |
UserCanAuthor ($User) | |
Determine if the given user can edit the resource. More... | |
UserCanModify ($User) | |
Check if the user is allowed to modify (Edit for perm resources, Author for temp) a specified resources. More... | |
UserCanViewField ($User, $FieldOrFieldName) | |
Check whether user is allowed to view specified metadata field. More... | |
UserCanEditField ($User, $FieldOrFieldName) | |
Check whether user is allowed to edit specified metadata field. More... | |
UserCanAuthorField ($User, $FieldOrFieldName) | |
Check whether user is allowed to author specified metadata field. More... | |
UserCanModifyField ($User, $FieldOrFieldName) | |
Check whether user is allowed to modify (Edit for perm resources, Author for temp) specified metadata field. More... | |
QueueSearchAndRecommenderUpdate () | |
Update search and recommender system DBs. More... | |
![]() | |
__construct ($Id) | |
Constructor, used to load existing items. More... | |
Delete () | |
Destroy item. More... | |
Id () | |
Get item ID. More... | |
Static Public Member Functions | |
static | Create ($SchemaId) |
Create a new resource. More... | |
static | GetSchemaForResource ($ResourceId) |
Get schema ID for specified resource(s). More... | |
![]() | |
static | GetCanonicalId ($Id) |
Normalize item ID to canonical form. More... | |
static | ItemExists ($Id) |
Check whether an item exists with the specified ID. More... | |
Static Protected Member Functions | |
static | SetDatabaseAccessValues ($ClassName) |
Set the database access values (table name, ID column name, name column name) for specified class. More... | |
![]() | |
static | CreateWithValues ($Values) |
Create a new item, using specified initial database values. More... | |
static | SetDatabaseAccessValues ($ClassName) |
Set the database access values (table name, ID column name, name column name) for specified class. More... | |
Additional Inherited Members | |
![]() | |
UpdateValue ($ColumnName, $NewValue=DB_NOVALUE) | |
Convenience function to supply parameters to Database->UpdateValue(). More... | |
![]() | |
$DB | |
$Id | |
$ItemIdColumnName | |
$ItemNameColumnName | |
$ItemTableName | |
$ValueCache = array() | |
![]() | |
static | $ItemIdColumnNames |
static | $ItemNameColumnNames |
static | $ItemTableNames |
Represents a "resource" in CWIS.
Definition at line 13 of file Resource.php.
Resource::__construct | ( | $ResourceId | ) |
Object constructor for loading an existing resource.
(To create a new resource, use Resource::Create().)
int | $ResourceId | ID of resource to load. |
Definition at line 24 of file Resource.php.
References CumulativeRating(), and SchemaId().
Resource::Classifications | ( | ) |
Get 2D array of classifications associated with resource.
Definition at line 2159 of file Resource.php.
References Item\$DB, and Id().
Referenced by Delete().
Resource::Clear | ( | $Field, | |
$ValueToClear = NULL |
|||
) |
Clear field value.
object | $Field | Metadata field. |
mixed | $ValueToClear | Specific value to clear (for fields that support multiple values). (OPTIONAL) |
Definition at line 1795 of file Resource.php.
References Item\$DB, Item\$Id, SPTImage\ClearImageSymlinksForResource(), Get(), Id(), IsTempResource(), MetadataSchema\MDFTYPE_CONTROLLEDNAME, MetadataSchema\MDFTYPE_DATE, MetadataSchema\MDFTYPE_FILE, MetadataSchema\MDFTYPE_FLAG, MetadataSchema\MDFTYPE_IMAGE, MetadataSchema\MDFTYPE_NUMBER, MetadataSchema\MDFTYPE_OPTION, MetadataSchema\MDFTYPE_PARAGRAPH, MetadataSchema\MDFTYPE_POINT, MetadataSchema\MDFTYPE_REFERENCE, MetadataSchema\MDFTYPE_TEXT, MetadataSchema\MDFTYPE_TIMESTAMP, MetadataSchema\MDFTYPE_TREE, MetadataSchema\MDFTYPE_URL, MetadataSchema\MDFTYPE_USER, and Schema().
Referenced by ClearByField(), and ClearByFieldId().
Resource::ClearByField | ( | $Field, | |
$ValueToClear = NULL |
|||
) |
Clear field value.
DEPRECATED in favor of Clear().
object | $Field | Metadata field. |
mixed | $ValueToClear | Specific value to clear (for fields that support multiple values). (OPTIONAL) |
Definition at line 2147 of file Resource.php.
References Clear().
Referenced by Set().
Resource::ClearByFieldId | ( | $FieldId, | |
$ValueToClear = NULL |
|||
) |
Clear field value specified by field ID.
int | $FieldId | Metadata field ID. |
mixed | $ValueToClear | Specific value to clear (for fields that support multiple values). (OPTIONAL) |
Definition at line 1783 of file Resource.php.
Resource::Comments | ( | ) |
Get comments for resource.
Definition at line 2338 of file Resource.php.
References Id().
|
static |
Create a new resource.
int | $SchemaId | ID of metadata schema for new resource. |
Exception | If resource creation failed. |
Definition at line 47 of file Resource.php.
References Item\$DB, Item\$Id, Id(), MetadataSchema\MDFTYPE_FLAG, MetadataSchema\MDFTYPE_NUMBER, MetadataSchema\MDFTYPE_OPTION, MetadataSchema\MDFTYPE_POINT, MetadataSchema\MDFTYPE_TEXT, MetadataSchema\SCHEMAID_DEFAULT, and MetadataField\UPDATEMETHOD_ONRECORDCREATE.
Referenced by CWUserFactory\CreateNewUser(), ResourceFactory\DuplicateResource(), and Resource_Test\testGetandSet().
Resource::CumulativeRating | ( | ) |
Get cumulative rating (range is usually 0-100)
Definition at line 2192 of file Resource.php.
Referenced by __construct(), GetAsArray(), GetSchemaForResource(), NumberOfRatings(), and ScaledCumulativeRating().
Resource::Delete | ( | ) |
Remove resource (and accompanying associations) from database and delete any associated files.
Definition at line 138 of file Resource.php.
References Item\$DB, Classifications(), and Id().
Referenced by CWUser\Delete().
Resource::FieldIsSet | ( | $FieldNameOrObject, | |
$IgnorePadding = FALSE |
|||
) |
Determine if the value for a field is set.
mixed | $FieldNameOrObject | Full name of field or a Field object. |
bool | $IgnorePadding | Optional flag for ignoring whitespace padding for text, paragraph, number, and URL fields. |
Definition at line 1037 of file Resource.php.
References Get(), MetadataSchema\MDFTYPE_CONTROLLEDNAME, MetadataSchema\MDFTYPE_DATE, MetadataSchema\MDFTYPE_FILE, MetadataSchema\MDFTYPE_FLAG, MetadataSchema\MDFTYPE_IMAGE, MetadataSchema\MDFTYPE_NUMBER, MetadataSchema\MDFTYPE_OPTION, MetadataSchema\MDFTYPE_PARAGRAPH, MetadataSchema\MDFTYPE_POINT, MetadataSchema\MDFTYPE_REFERENCE, MetadataSchema\MDFTYPE_TEXT, MetadataSchema\MDFTYPE_TIMESTAMP, MetadataSchema\MDFTYPE_TREE, MetadataSchema\MDFTYPE_URL, MetadataSchema\MDFTYPE_USER, and Schema().
Resource::Get | ( | $Field, | |
$ReturnObject = FALSE , |
|||
$IncludeVariants = FALSE |
|||
) |
Retrieve value using field name or field object.
mixed | $Field | Field ID or full name of field or a Field object. |
bool | $ReturnObject | For field types that can return multiple values, if TRUE, returns array of objects, else returns array of values. Defaults to FALSE. |
bool | $IncludeVariants | If TRUE, includes variants in return value. Only applicable for ControlledName fields. |
Definition at line 410 of file Resource.php.
References FileFactory\GetFilesForResource(), Id(), MetadataSchema\MDFTYPE_CONTROLLEDNAME, MetadataSchema\MDFTYPE_DATE, MetadataSchema\MDFTYPE_FILE, MetadataSchema\MDFTYPE_FLAG, MetadataSchema\MDFTYPE_IMAGE, MetadataSchema\MDFTYPE_NUMBER, MetadataSchema\MDFTYPE_OPTION, MetadataSchema\MDFTYPE_PARAGRAPH, MetadataSchema\MDFTYPE_POINT, MetadataSchema\MDFTYPE_REFERENCE, MetadataSchema\MDFTYPE_TEXT, MetadataSchema\MDFTYPE_TIMESTAMP, MetadataSchema\MDFTYPE_TREE, MetadataSchema\MDFTYPE_URL, MetadataSchema\MDFTYPE_USER, Schema(), and SchemaId().
Referenced by Clear(), FieldIsSet(), CWUser\Get(), GetAsArray(), GetByField(), GetByFieldId(), GetForDisplay(), GetImageUrls(), GetMapped(), GetQualifierByField(), GetSchemaForResource(), and Set().
Resource::GetAsArray | ( | $IncludeDisabledFields = FALSE , |
|
$ReturnObjects = TRUE |
|||
) |
Retrieve all resource values as an array.
bool | $IncludeDisabledFields | Include values for disabled fields. (OPTIONAL, defaults to FALSE) |
bool | $ReturnObjects | If TRUE, an object is returned for field types where appropriate, in the same fashion as Resource::Get() (OPTIONAL, defaults to TRUE) |
Definition at line 811 of file Resource.php.
References CumulativeRating(), Get(), GetQualifierByField(), Id(), and Schema().
Resource::GetByField | ( | $FieldNameOrObject, | |
$ReturnObject = FALSE , |
|||
$IncludeVariants = FALSE |
|||
) |
Old method for retrieving values, deprecated in favor of Get().
mixed | $FieldNameOrObject | Full name of field or a Field object. |
bool | $ReturnObject | For field types that can return multiple values, if TRUE, returns array of objects, else returns array of values. Defaults to FALSE. |
bool | $IncludeVariants | If TRUE, includes variants in return value. Only applicable for ControlledName fields. |
Definition at line 773 of file Resource.php.
References Get().
Resource::GetByFieldId | ( | $FieldId, | |
$ReturnObject = FALSE , |
|||
$IncludeVariants = FALSE |
|||
) |
Retrieve value using field ID.
int | $FieldId | ID of field. |
bool | $ReturnObject | For field types that can return multiple values, if TRUE, returns array of objects, else returns array of values. Defaults to FALSE. |
bool | $IncludeVariants | If TRUE, includes variants in return value. Only applicable for ControlledName fields. |
Definition at line 793 of file Resource.php.
References Get().
Resource::GetForDisplay | ( | $FieldNameOrObject, | |
$ReturnObject = TRUE , |
|||
$IncludeVariants = FALSE |
|||
) |
Retrieve value using field name or field object, signaling EVENT_FIELD_DISPLAY_FILTER to allow other code to possibly modify the value before it's returned.
Note that the default for the $ReturnObject parameter is TRUE, which is the opposite of the default for the same parameter to all other Resource::Get*() methods.
mixed | $FieldNameOrObject | Full name of field or a Field object. |
bool | $ReturnObject | For field types that can return multiple values, if TRUE, returns array of objects, else returns array of values. (OPTIONAL, defaults to TRUE) |
bool | $IncludeVariants | If TRUE, includes variants in return value. Only applicable for ControlledName fields. (OPTIONAL, defaults to FALSE) |
Definition at line 737 of file Resource.php.
Resource::GetImageUrls | ( | $FieldNameOrObject, | |
$ImageSize = SPTImage::SIZE_FULL |
|||
) |
Get URLs for images, returning CleanURLs when possible and direct paths to image files otherwise.
mixed | $FieldNameOrObject | Full field name, FieldId, or a MetadataField object. |
mixed | $ImageSize | Desired size as an SPTImage::SIZE_ constant. |
Definition at line 1107 of file Resource.php.
Resource::GetMapped | ( | $MappedName, | |
$ReturnObject = FALSE , |
|||
$IncludeVariants = FALSE |
|||
) |
Retrieve value using standard (mapped) field name.
string | $MappedName | Standard field name. |
bool | $ReturnObject | For field types that can return multiple values, if TRUE, returns array of objects, else returns array of values. Defaults to FALSE. |
bool | $IncludeVariants | If TRUE, includes variants in return value. Only applicable for ControlledName fields. Defaults to FALSE. |
Definition at line 857 of file Resource.php.
Resource::GetQualifier | ( | $FieldName, | |
$ReturnObject = TRUE |
|||
) |
Retrieve qualifier by field name.
string | $FieldName | Full name of field. |
bool | $ReturnObject | If TRUE, return Qualifier objects, else return qualifier IDs. Defaults to TRUE. |
Definition at line 875 of file Resource.php.
References GetQualifierByField(), and Schema().
Resource::GetQualifierByField | ( | $Field, | |
$ReturnObject = TRUE |
|||
) |
Retrieve qualifier by Field object.
MetadataField | $Field | Field object. |
bool | $ReturnObject | If TRUE, return Qualifier objects, else return qualifier IDs. Defaults to TRUE. |
Definition at line 903 of file Resource.php.
References $Items, Get(), MetadataSchema\MDFTYPE_CONTROLLEDNAME, MetadataSchema\MDFTYPE_OPTION, and MetadataSchema\MDFTYPE_TREE.
Referenced by GetAsArray(), GetQualifier(), and GetQualifierByFieldId().
Resource::GetQualifierByFieldId | ( | $FieldId, | |
$ReturnObject = TRUE |
|||
) |
Retrieve qualifier by field ID.
int | $FieldId | ID of field. |
int | $ReturnObject | If TRUE, return Qualifier objects, else return qualifier IDs. Defaults to TRUE. |
Definition at line 889 of file Resource.php.
References GetQualifierByField(), and Schema().
|
static |
Get schema ID for specified resource(s).
int | $ResourceId | ID of resource or array of IDs of resources. |
Definition at line 2499 of file Resource.php.
References Item\$DB, CumulativeRating(), Get(), Id(), and Schema().
Resource::GetViewPageUrl | ( | ) |
Retrieve view page URL for this resource.
Definition at line 386 of file Resource.php.
Resource::Id | ( | ) |
Retrieve numerical resource ID.
Definition at line 287 of file Resource.php.
References Item\$Id.
Referenced by Classifications(), Clear(), Comments(), Create(), Delete(), Get(), GetAsArray(), GetImageUrls(), GetSchemaForResource(), GetViewPageUrl(), IsTempResource(), NumberOfComments(), NumberOfRatings(), Rating(), CWUser\ResourceId(), and Set().
Resource::IsTempResource | ( | $NewSetting = NULL | ) |
Get/set whether resource is a temporary record.
bool | $NewSetting | TRUE/FALSE setting for whether resource is temporary. (OPTIONAL) |
Definition at line 316 of file Resource.php.
References Item\$DB, Item\$Id, Id(), and SchemaId().
Referenced by Clear(), QueueSearchAndRecommenderUpdate(), and Set().
Resource::NumberOfComments | ( | ) |
Get current number of comments for resource.
Definition at line 2361 of file Resource.php.
References Id().
Resource::NumberOfRatings | ( | ) |
Get current number of ratings for resource.
Definition at line 2217 of file Resource.php.
References CumulativeRating(), and Id().
Resource::QueueSearchAndRecommenderUpdate | ( | ) |
Update search and recommender system DBs.
Definition at line 2482 of file Resource.php.
References IsTempResource().
Resource::Rating | ( | $NewRating = NULL , |
|
$UserId = NULL |
|||
) |
Get/set rating by a specific user for resource.
int | $NewRating | New rating value. |
int | $UserId | ID of user rating resource. |
Definition at line 2248 of file Resource.php.
Resource::ScaledCumulativeRating | ( | ) |
Return cumulative rating scaled to 1/10th.
(Range is usually 0-10.)
Definition at line 2201 of file Resource.php.
References CumulativeRating().
Resource::Schema | ( | ) |
Get MetadataSchema for resource.
Definition at line 305 of file Resource.php.
Referenced by Clear(), ClearByFieldId(), FieldIsSet(), Get(), GetAsArray(), GetForDisplay(), GetImageUrls(), GetMapped(), GetQualifier(), GetQualifierByFieldId(), GetSchemaForResource(), GetViewPageUrl(), Set(), SetQualifier(), SetQualifierByFieldId(), and UpdateAutoupdateFields().
Resource::SchemaId | ( | ) |
Retrieve ID of schema for resource.
Definition at line 296 of file Resource.php.
Referenced by __construct(), Get(), IsTempResource(), and Set().
Resource::Set | ( | $Field, | |
$NewValue, | |||
$Reset = FALSE |
|||
) |
Set value using field name or field object.
mixed | $Field | Field ID or full name of field or a Field object. |
mixed | $NewValue | New value for field. |
bool | $Reset | When TRUE Controlled Names, Classifications, and Options will be set to contain ONLY the contents of NewValue, rather than appending $NewValue to the current value. |
Exception | When attempting to set a value for a field that is part of a different schema than the resource. |
InvalidArgumentException | When attempting to set a controlled name with an invalid ID. |
Definition at line 1142 of file Resource.php.
References Item\$DB, Item\$Id, ClearByField(), SPTImage\ClearImageSymlinksForResource(), FileFactory\Copy(), Get(), Id(), IsTempResource(), MetadataSchema\MDFTYPE_CONTROLLEDNAME, MetadataSchema\MDFTYPE_DATE, MetadataSchema\MDFTYPE_FILE, MetadataSchema\MDFTYPE_FLAG, MetadataSchema\MDFTYPE_IMAGE, MetadataSchema\MDFTYPE_NUMBER, MetadataSchema\MDFTYPE_OPTION, MetadataSchema\MDFTYPE_PARAGRAPH, MetadataSchema\MDFTYPE_POINT, MetadataSchema\MDFTYPE_REFERENCE, MetadataSchema\MDFTYPE_TEXT, MetadataSchema\MDFTYPE_TIMESTAMP, MetadataSchema\MDFTYPE_TREE, MetadataSchema\MDFTYPE_URL, MetadataSchema\MDFTYPE_USER, Schema(), SchemaId(), and ControlledName\STATUS_OK.
Referenced by CWUser\Set(), SetByField(), SetByFieldId(), and UpdateAutoupdateFields().
Resource::SetByField | ( | $Field, | |
$NewValue | |||
) |
Method replaced by Resource::Set(), preserved for backward compatibility.
object | $Field | MetadataField object. |
mixed | $NewValue | New value for field. |
Definition at line 1705 of file Resource.php.
References Set().
Resource::SetByFieldId | ( | $FieldId, | |
$NewValue | |||
) |
Set field value using field ID.
int | $FieldId | Metadata field ID. |
mixed | $NewValue | Value to set. |
Definition at line 1717 of file Resource.php.
References Set().
|
staticprotected |
Set the database access values (table name, ID column name, name column name) for specified class.
This may be overridden in a child class, if different values are needed.
string | $ClassName | Class to set values for. |
Definition at line 2813 of file Resource.php.
Resource::SetQualifier | ( | $FieldName, | |
$NewValue | |||
) |
Set qualifier using field name.
string | $FieldName | Metadata field name. |
mixed | $NewValue | Qualifier object or ID. |
Definition at line 1727 of file Resource.php.
References Schema(), and SetQualifierByField().
Resource::SetQualifierByField | ( | $Field, | |
$NewValue | |||
) |
Set qualifier using field object.
object | $Field | Metadata field. |
mixed | $NewValue | Qualifier object or ID. |
Definition at line 1749 of file Resource.php.
Referenced by SetQualifier(), and SetQualifierByFieldId().
Resource::SetQualifierByFieldId | ( | $FieldId, | |
$NewValue | |||
) |
Set qualifier using field ID.
int | $FieldId | Metadata field ID. |
mixed | $NewValue | Qualifier object or ID. |
Definition at line 1738 of file Resource.php.
References Schema(), and SetQualifierByField().
Resource::UpdateAutoupdateFields | ( | $UpdateType, | |
$User = NULL |
|||
) |
Update the auto-updated fields as necessary.
int | $UpdateType | Type of update being performed, one of the MetadataField::UPDATEMETHOD_ constants. |
CWUser | $User | User responsible for the update (OPTIONAL). |
Definition at line 255 of file Resource.php.
References MetadataSchema\MDFTYPE_TIMESTAMP, MetadataSchema\MDFTYPE_USER, Schema(), and Set().
Resource::UserCanAuthor | ( | $User | ) |
Determine if the given user can edit the resource.
The result of this method can be modified via the EVENT_RESOURCE_EDIT_PERMISSION_CHECK event.
Definition at line 2413 of file Resource.php.
Resource::UserCanAuthorField | ( | $User, | |
$FieldOrFieldName | |||
) |
Check whether user is allowed to author specified metadata field.
Definition at line 2458 of file Resource.php.
Resource::UserCanEdit | ( | $User | ) |
Determine if the given user can edit the resource.
The result of this method can be modified via the EVENT_RESOURCE_EDIT_PERMISSION_CHECK event.
Definition at line 2402 of file Resource.php.
Resource::UserCanEditField | ( | $User, | |
$FieldOrFieldName | |||
) |
Check whether user is allowed to edit specified metadata field.
Definition at line 2447 of file Resource.php.
Resource::UserCanModify | ( | $User | ) |
Check if the user is allowed to modify (Edit for perm resources, Author for temp) a specified resources.
Definition at line 2424 of file Resource.php.
Resource::UserCanModifyField | ( | $User, | |
$FieldOrFieldName | |||
) |
Check whether user is allowed to modify (Edit for perm resources, Author for temp) specified metadata field.
Definition at line 2470 of file Resource.php.
Resource::UserCanView | ( | User | $User, |
$AllowHooksToModify = TRUE |
|||
) |
Determine if the given user can view the resource, e.g., on the full record page.
The result of this method can be modified via the EVENT_RESOURCE_VIEW_PERMISSION_CHECK event.
User | $User | User to check against. |
bool | $AllowHooksToModify | TRUE if hook functions should be allowed to modify the return value (OPTIONAL default TRUE). |
Definition at line 2391 of file Resource.php.
Resource::UserCanViewField | ( | $User, | |
$FieldOrFieldName | |||
) |
Check whether user is allowed to view specified metadata field.
Definition at line 2436 of file Resource.php.