|
CWIS Developer Documentation
|
Common base class for persistent items store in database. More...

Public Member Functions | |
| __construct ($Id) | |
| Constructor, used to load existing items. More... | |
| Delete () | |
| Destroy item. More... | |
| Id () | |
| Get item ID. More... | |
Static Public Member Functions | |
| static | GetCanonicalId ($Id) |
| Normalize item ID to canonical form. More... | |
| static | ItemExists ($Id) |
| Check whether an item exists with the specified ID. More... | |
Protected Member Functions | |
| UpdateValue ($ColumnName, $NewValue=DB_NOVALUE) | |
| Convenience function to supply parameters to Database->UpdateValue(). More... | |
Static Protected Member Functions | |
| 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... | |
Protected Attributes | |
| $DB | |
| $Id | |
| $ItemIdColumnName | |
| $ItemNameColumnName | |
| $ItemTableName | |
| $ValueCache = array() | |
Static Protected Attributes | |
| static | $ItemIdColumnNames |
| static | $ItemNameColumnNames |
| static | $ItemTableNames |
| Item::__construct | ( | $Id | ) |
Constructor, used to load existing items.
To create new items, child classes should implement a static Create() method.
| mixed | $Id | ID of item to load, in a form resolvable by GetCanonicalId(). |
|
staticprotected |
| Item::Delete | ( | ) |
|
static |
| Item::Id | ( | ) |
Get item ID.
Definition at line 67 of file Item.php.
References $Id.
Referenced by __construct(), Delete(), and UpdateValue().

|
static |
Check whether an item exists with the specified ID.
This only checks whether there is an entry for an item with the specified ID in the database – it does not check anything else (e.g. the type of the item).
| int | $Id | ID to check. |
Definition at line 89 of file Item.php.
Referenced by ResourceFactory\DuplicateResource().

|
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 172 of file Item.php.
References StdLib\Pluralize().
|
protected |
Convenience function to supply parameters to Database->UpdateValue().
| string | $ColumnName | Name of database column. |
| string | $NewValue | New value for field. (OPTIONAL) |
Definition at line 189 of file Item.php.
References Id().
Referenced by Classification\FieldId(), Classification\LinkString(), Classification\QualifierId(), Classification\RecalcDepthAndFullName(), Classification\RecalcResourceCount(), and Classification\SegmentName().

|
protected |
Definition at line 115 of file Item.php.
Referenced by Resource\Classifications(), Resource\Clear(), Classification\Create(), Resource\Create(), CreateWithValues(), Resource\Delete(), Resource\GetSchemaForResource(), Resource\IsTempResource(), ItemExists(), Resource\Rating(), and Resource\Set().
|
protected |
Definition at line 116 of file Item.php.
Referenced by __construct(), Resource\Clear(), Resource\Create(), GetCanonicalId(), Id(), Classification\Id(), Resource\Id(), Resource\IsTempResource(), ItemExists(), Classification\RecalcResourceCount(), and Resource\Set().