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... | |
UserCanViewMappedField ($User, $MappedName) | |
Check whether user can view specified standard (mapped) 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... | |
Destroy () | |
Destroy item. More... | |
Delete () | |
Destroy item. More... | |
Id () | |
Get item ID. More... | |
Name ($NewValue=DB_NOVALUE) | |
Get/set name of item. More... | |
DateCreated ($NewValue=DB_NOVALUE) | |
Get/set when item was created. More... | |
CreatedBy ($NewValue=DB_NOVALUE) | |
Get/set ID of user who created the item. More... | |
DateLastModified ($NewValue=DB_NOVALUE) | |
Get/set when item was last modified. More... | |
LastModifiedBy ($NewValue=DB_NOVALUE) | |
Get/set ID of user who last modified the item. 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 | |
![]() | |
const | NO_ITEM = -2123456789 |
ID value used to indicate no item. More... | |
![]() | |
UpdateValue ($ColumnName, $NewValue=DB_NOVALUE) | |
Convenience function to supply parameters to Database::UpdateValue(). More... | |
UpdateDateValue ($ColumnName, $NewValue=DB_NOVALUE) | |
Convenience function to supply parameters to Database::UpdateValue(), with preprocessing of new values to convert them into an SQL-compatible date format. 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. |
InvalidArgumentException | If ID is invalid. |
Definition at line 25 of file Resource.php.
References CumulativeRating(), and SchemaId().
Resource::Classifications | ( | ) |
Get 2D array of classifications associated with resource.
Definition at line 2008 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 1835 of file Resource.php.
References 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, Schema(), and Set().
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 1996 of file Resource.php.
References Clear().
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 1823 of file Resource.php.
Resource::Comments | ( | ) |
Get comments for resource.
Definition at line 2177 of file Resource.php.
References Id().
Referenced by Resource_Test\testResource().
|
static |
Create a new resource.
int | $SchemaId | ID of metadata schema for new resource. |
Exception | If resource creation failed. |
Definition at line 48 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(), ResourceFactory\ImportResourcesFromXmlFile(), and Resource_Test\testResource().
Resource::CumulativeRating | ( | ) |
Get cumulative rating (range is usually 0-100)
Definition at line 2041 of file Resource.php.
Referenced by __construct(), GetAsArray(), GetSchemaForResource(), and ScaledCumulativeRating().
Resource::Delete | ( | ) |
Remove resource (and accompanying associations) from database and delete any associated files.
Definition at line 142 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 1053 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 420 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(), Set(), and Resource_Test\testResource().
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 828 of file Resource.php.
References CumulativeRating(), Get(), GetQualifierByField(), Id(), and Schema().
Referenced by Resource_Test\testResource().
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 790 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 810 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 754 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 1118 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 874 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 891 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 919 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 905 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 2351 of file Resource.php.
References Item\$DB, CumulativeRating(), Id(), NumberOfRatings(), and Schema().
Referenced by Resource_Test\testResource().
Resource::GetViewPageUrl | ( | ) |
Retrieve view page URL for this resource.
Definition at line 396 of file Resource.php.
Resource::Id | ( | ) |
Retrieve numerical resource ID.
Definition at line 294 of file Resource.php.
References Item\$Id.
Referenced by Classifications(), Clear(), Comments(), Create(), Delete(), Get(), GetAsArray(), GetImageUrls(), GetSchemaForResource(), GetViewPageUrl(), IsTempResource(), NumberOfComments(), 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 323 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 2200 of file Resource.php.
References Id().
Resource::NumberOfRatings | ( | ) |
Get current number of ratings for resource.
Definition at line 2066 of file Resource.php.
Referenced by GetSchemaForResource().
Resource::QueueSearchAndRecommenderUpdate | ( | ) |
Update search and recommender system DBs.
Definition at line 2334 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 2085 of file Resource.php.
Resource::ScaledCumulativeRating | ( | ) |
Return cumulative rating scaled to 1/10th.
(Range is usually 0-10.)
Definition at line 2050 of file Resource.php.
References CumulativeRating().
Resource::Schema | ( | ) |
Get MetadataSchema for resource.
Definition at line 312 of file Resource.php.
Referenced by Clear(), ClearByFieldId(), FieldIsSet(), Get(), GetAsArray(), GetForDisplay(), GetImageUrls(), GetMapped(), GetQualifier(), GetQualifierByFieldId(), GetSchemaForResource(), GetViewPageUrl(), Set(), SetQualifier(), SetQualifierByFieldId(), UpdateAutoupdateFields(), and UserCanViewMappedField().
Resource::SchemaId | ( | ) |
Retrieve ID of schema for resource.
Definition at line 303 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 1153 of file Resource.php.
References Item\$DB, Item\$Id, SPTImage\ClearImageSymlinksForResource(), FileFactory\Copy(), Get(), Id(), IsTempResource(), Item\ItemExists(), 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(), 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 1745 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 1757 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 2649 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 1767 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 1789 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 1778 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 262 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 2252 of file Resource.php.
Resource::UserCanAuthorField | ( | $User, | |
$FieldOrFieldName | |||
) |
Check whether user is allowed to author specified metadata field.
Definition at line 2310 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 2241 of file Resource.php.
Resource::UserCanEditField | ( | $User, | |
$FieldOrFieldName | |||
) |
Check whether user is allowed to edit specified metadata field.
Definition at line 2299 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 2263 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 2322 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 2230 of file Resource.php.
Resource::UserCanViewField | ( | $User, | |
$FieldOrFieldName | |||
) |
Check whether user is allowed to view specified metadata field.
Definition at line 2275 of file Resource.php.
Resource::UserCanViewMappedField | ( | $User, | |
$MappedName | |||
) |
Check whether user can view specified standard (mapped) metadata field.
Definition at line 2286 of file Resource.php.
References Schema().