CWIS Developer Documentation
|
Factory for Resource objects. More...
Public Member Functions | |
__construct ($SchemaId=MetadataSchema::SCHEMAID_DEFAULT) | |
Class constructor. More... | |
DuplicateResource ($ResourceId) | |
Duplicate the specified resource and return to caller. More... | |
ClearQualifier ($ObjectOrId, $NewObjectOrId=NULL) | |
Clear or change specific qualifier for all resources. More... | |
GetRatedResourceCount () | |
Return number of resources that have ratings. More... | |
GetRatedResourceUserCount () | |
Return number of users who have rated resources. More... | |
GetRecentlyReleasedResources ($Count=10, $Offset=0, $MaxDaysToGoBack=90) | |
Get resources sorted by descending Date of Record Release, with Date of Record Creation as the secondary sort criteria. More... | |
GetResourceIdsSortedBy ($FieldId, $Ascending=TRUE, $Limit=NULL) | |
Get resource IDs sorted by specified field. More... | |
FilterNonViewableResources ($ResourceIds, $User) | |
Filter a list of resources leaving only those viewable by a specified user. More... | |
ClearViewingPermsCache () | |
Clear the cache of viewable resources. More... | |
GetTimestampOfLastResourceModification ($OnlyReleasedResources=TRUE) | |
Get date/time of when last a resource was modified. More... | |
GetPossibleFieldNames () | |
Get possible field names for resources. More... | |
GetMatchingResources ($ValuesToMatch, $AllRequired=TRUE, $ReturnObjects=TRUE) | |
Find resources with values that match those specified. More... | |
AssociatedVisibleResourceCount ($ValueId, $User) | |
Return the number of resources visible to a specified user that have a given ControlledName value set. More... | |
UpdateAssociatedVisibleResourceCount ($ValueId, $UserId) | |
Update the count of resources associated with a ControlledName that are visible to a specified user. More... | |
GetReleasedResourceTotal () | |
Get the total number of released resources in the collection. More... | |
GetResourceTotal () | |
Get the total number of resources in the collection, even if they are not released. More... | |
![]() | |
__construct ($ItemClassName, $ItemTableName, $ItemIdFieldName, $ItemNameFieldName=NULL, $OrderOpsAllowed=FALSE, $SqlCondition=NULL) | |
Class constructor. More... | |
GetItemClassName () | |
Get class name of items manipulated by factory. More... | |
CleanOutStaleTempItems ($MinutesUntilStale=10080) | |
Clear out (call the Delete() method) for any temp items more than specified number of minutes old. More... | |
GetNextItemId () | |
Retrieve next available (non-temp) item ID. More... | |
GetHighestItemId ($IgnoreSqlCondition=FALSE) | |
Retrieve highest item ID in use. More... | |
GetNextTempItemId () | |
Return next available temporary item ID. More... | |
GetItemCount ($Condition=NULL, $IncludeTempItems=FALSE) | |
Get count of items. More... | |
GetItemIds ($Condition=NULL, $IncludeTempItems=FALSE, $SortField=NULL, $SortAscending=TRUE) | |
Return array of item IDs. More... | |
GetLatestModificationDate ($Condition=NULL) | |
Get newest modification date (based on values in "DateLastModified" column in database table). More... | |
GetItem ($ItemId) | |
Retrieve item by item ID. More... | |
ItemExists ($ItemId, $IgnoreSqlCondition=FALSE) | |
Check that item exists with specified ID. More... | |
GetItemByName ($Name, $IgnoreCase=FALSE) | |
Retrieve item by name. More... | |
GetItemIdByName ($Name, $IgnoreCase=FALSE) | |
Retrieve item ID by name. More... | |
GetItemNames ($SqlCondition=NULL) | |
Retrieve item names. More... | |
GetItems ($SqlCondition=NULL) | |
Retrieve items. More... | |
GetItemsAsOptionList ($OptionListName, $SelectedItemId=NULL, $SqlCondition=NULL, $DisplaySize=1, $SubmitOnChange=FALSE, $Disabled=FALSE) | |
Retrieve items of specified type as HTML option list with item names as labels and item IDs as value attributes. More... | |
NameIsInUse ($Name, $IgnoreCase=FALSE) | |
Check whether item name is currently in use. More... | |
SearchForItemNames ($SearchString, $NumberOfResults=100, $IncludeVariants=FALSE, $UseBooleanMode=TRUE, $Offset=0, $IdExclusions=array(), $ValueExclusions=array()) | |
Retrieve items with names matching search string. More... | |
GetCountForItemNames ($SearchString, $IncludeVariants=FALSE, $UseBooleanMode=TRUE, $IdExclusions=array(), $ValueExclusions=array()) | |
Retrieve count of items with names matching search string. More... | |
CachingEnabled ($NewValue=NULL) | |
Enable/disable caching of item information. More... | |
ClearCaches () | |
Clear item information caches. More... | |
SetOrderOpsCondition ($Condition) | |
Set SQL condition (added to WHERE clause) used to select items for ordering operations. More... | |
InsertBefore ($TargetItem, $NewItem) | |
Insert item into order before specified item. More... | |
InsertAfter ($TargetItem, $NewItem) | |
Insert item into order after specified item. More... | |
Prepend ($Item) | |
Add item to beginning of order. More... | |
Append ($Item) | |
Add item to end of order. More... | |
GetItemIdsInOrder () | |
Retrieve list of item IDs in order. More... | |
RemoveItemFromOrder ($ItemId) | |
Remove item from existing order. More... | |
Additional Inherited Members | |
![]() | |
$DB | |
Factory for Resource objects.
Definition at line 13 of file ResourceFactory.php.
ResourceFactory::__construct | ( | $SchemaId = MetadataSchema::SCHEMAID_DEFAULT | ) |
Class constructor.
int | $SchemaId | ID of schema to load resources for. (OPTIONAL, defaults to SCHEMAID_DEFAULT) |
Definition at line 22 of file ResourceFactory.php.
ResourceFactory::AssociatedVisibleResourceCount | ( | $ValueId, | |
$User | |||
) |
Return the number of resources visible to a specified user that have a given ControlledName value set.
Definition at line 576 of file ResourceFactory.php.
ResourceFactory::ClearQualifier | ( | $ObjectOrId, | |
$NewObjectOrId = NULL |
|||
) |
Clear or change specific qualifier for all resources.
mixed | $ObjectOrId | Qualifier ID or object to clear or change. |
mixed | $NewObjectOrId | New Qualifier ID or object. (OPTIONAL, defaults to NULL, which will clear old qualifier) |
Definition at line 83 of file ResourceFactory.php.
ResourceFactory::ClearViewingPermsCache | ( | ) |
Clear the cache of viewable resources.
Definition at line 369 of file ResourceFactory.php.
References ItemFactory\$DB.
ResourceFactory::DuplicateResource | ( | $ResourceId | ) |
Duplicate the specified resource and return to caller.
int | $ResourceId | ID of resource to duplicate. |
Definition at line 40 of file ResourceFactory.php.
References Resource\Create(), and Item\ItemExists().
ResourceFactory::FilterNonViewableResources | ( | $ResourceIds, | |
$User | |||
) |
Filter a list of resources leaving only those viewable by a specified user.
Definition at line 296 of file ResourceFactory.php.
References ItemFactory\$DB.
Referenced by UpdateAssociatedVisibleResourceCount().
ResourceFactory::GetMatchingResources | ( | $ValuesToMatch, | |
$AllRequired = TRUE , |
|||
$ReturnObjects = TRUE |
|||
) |
Find resources with values that match those specified.
(Only works for Text, Paragraph, Number, Timestamp, Date, Flag, Url, Point, and User fields.)
array | $ValuesToMatch | Array with metadata field IDs (or other values that can be resolved by MetadataSchema::GetCanonicalFieldIdentifier()) for the index and string values to search for for the values. |
bool | $AllRequired | TRUE to AND conditions together, FALSE to OR them (OPTIONAL, default TRUE) |
bool | $ReturnObjects | TRUE to return Resource objects, FALSE for IDs |
Definition at line 424 of file ResourceFactory.php.
References MetadataSchema\MDFTYPE_DATE, MetadataSchema\MDFTYPE_FLAG, MetadataSchema\MDFTYPE_NUMBER, MetadataSchema\MDFTYPE_PARAGRAPH, MetadataSchema\MDFTYPE_POINT, MetadataSchema\MDFTYPE_TEXT, MetadataSchema\MDFTYPE_TIMESTAMP, MetadataSchema\MDFTYPE_URL, and MetadataSchema\MDFTYPE_USER.
ResourceFactory::GetPossibleFieldNames | ( | ) |
Get possible field names for resources.
Definition at line 397 of file ResourceFactory.php.
ResourceFactory::GetRatedResourceCount | ( | ) |
Return number of resources that have ratings.
Definition at line 138 of file ResourceFactory.php.
ResourceFactory::GetRatedResourceUserCount | ( | ) |
Return number of users who have rated resources.
Definition at line 150 of file ResourceFactory.php.
ResourceFactory::GetRecentlyReleasedResources | ( | $Count = 10 , |
|
$Offset = 0 , |
|||
$MaxDaysToGoBack = 90 |
|||
) |
Get resources sorted by descending Date of Record Release, with Date of Record Creation as the secondary sort criteria.
int | $Count | Maximum number of resources to return. |
int | $Offset | Starting offset of segment to return (0=beginning). |
int | $MaxDaysToGoBack | Maximum number of days to go back for resources, according to Date of Record Release. |
Definition at line 167 of file ResourceFactory.php.
ResourceFactory::GetReleasedResourceTotal | ( | ) |
Get the total number of released resources in the collection.
Definition at line 655 of file ResourceFactory.php.
ResourceFactory::GetResourceIdsSortedBy | ( | $FieldId, | |
$Ascending = TRUE , |
|||
$Limit = NULL |
|||
) |
Get resource IDs sorted by specified field.
Only IDs for resources with non-empty non-null values for the specified field are returned.
mixed | $FieldId | ID or name of field. |
bool | $Ascending | If TRUE, sort is ascending, otherwise sort is descending. |
int | $Limit | Number of IDs to retrieve. (OPTIONAL) |
Definition at line 205 of file ResourceFactory.php.
References MetadataSchema\MDFTYPE_DATE, MetadataSchema\MDFTYPE_NUMBER, MetadataSchema\MDFTYPE_PARAGRAPH, MetadataSchema\MDFTYPE_TEXT, MetadataSchema\MDFTYPE_TIMESTAMP, and MetadataSchema\MDFTYPE_URL.
ResourceFactory::GetResourceTotal | ( | ) |
Get the total number of resources in the collection, even if they are not released.
Definition at line 671 of file ResourceFactory.php.
References ItemFactory\$DB.
ResourceFactory::GetTimestampOfLastResourceModification | ( | $OnlyReleasedResources = TRUE | ) |
Get date/time of when last a resource was modified.
bool | $OnlyReleasedResources | If TRUE, only resources with the Release Flag set are considered. |
Definition at line 381 of file ResourceFactory.php.
ResourceFactory::UpdateAssociatedVisibleResourceCount | ( | $ValueId, | |
$UserId | |||
) |
Update the count of resources associated with a ControlledName that are visible to a specified user.
int | $ValueId | ControlledNameId to update. |
int | $UserId | UserId to update. |
Definition at line 619 of file ResourceFactory.php.
References FilterNonViewableResources().