The Controller for Tripal data type entities
◆ create()
TripalBundleController::create |
( |
array |
$values = [] | ) |
|
Create a type we first set up the values that are specific to our type schema but then also go through the EntityAPIController function.
- Parameters
-
$type | The machine-readable type of the tripal data entity. |
- Returns
- A type object with all default fields initialized.
◆ delete()
TripalBundleController::delete |
( |
|
$ids, |
|
|
DatabaseTransaction |
$transaction = NULL |
|
) |
| |
Overrides the parent delete function.
- Parameters
-
| $ids | |
DatabaseTransaction | $transaction | |
◆ deleteAllOrphans()
TripalBundleController::deleteAllOrphans |
( |
TripalJob |
$job = NULL | ) |
|
Deletes orphaned entities from all bundles.
An orphaned entity can occur if the module that created the entity unknowingly lost its underlying record in its data store. Such a case could happen if someone directly removed the record from the data store outside of the module's control. This function allows each module to report if any orphans are missing for a given bundle type.
- Parameters
-
TripalJob | $job | An optional Tripal Job object. This is provided when this function is called using the Tripal Jobs system. |
- Returns
- integer The number of entitites that were cleaned up.
◆ deleteOrphans()
TripalBundleController::deleteOrphans |
( |
int |
$id, |
|
|
TripalJob |
$job = NULL |
|
) |
| |
Deletes orphaned entities.
An orphaned entity can occur if the module that created the entity unknowingly lost its underlying record in its data store. Such a case could happen if someone directly removed the record from the data store outside of the module's control. This function allows each module to report if any orphans are missing for a given bundle type.
- Parameters
-
integer | $id | The ID of the bundle. |
TripalJob | $job | An optional Tripal Job object. This is provided when this function is called using the Tripal Jobs system. |
- Returns
- integer The number of entitites that were cleaned up.
◆ findAllOrphans()
TripalBundleController::findAllOrphans |
( |
|
$count = FALSE , |
|
|
|
$offset = 0 , |
|
|
|
$limit = 0 |
|
) |
| |
Finds any orphaned entities associated with all bundles.
An orphaned entity can occur if the module that created the entity unknowingly lost its underlying record in its data store. Such a case could happen if someone directly removed the record from the data store outside of the module's control. This function allows each module to report if any orphans are missing for a given bundle type.
- Parameters
-
bool | $count | Set to TRUE to return only a count of orphans. |
integer | $offset | For paging of entities set this to the offset within the total count. |
integer | $limit | For paging of entities set this to the total number to return. |
- Returns
- array|integer If $count == FALSE then an array of all entity IDs that are orphaned. If $count == TRUE then a single integer count value is returned.
◆ findOrphans()
TripalBundleController::findOrphans |
( |
|
$id, |
|
|
|
$count = FALSE , |
|
|
|
$offset = 0 , |
|
|
|
$limit = 0 |
|
) |
| |
Finds any orphaned entities associated with this bundle.
An orphaned entity can occur if the module that created the entity unknowingly lost its underlying record in its data store. Such a case could happen if someone directly removed the record from the data store outside of the module's control. This function allows each module to report if any orphans are missing for a given bundle type.
- Parameters
-
integer | $id | The ID of the bundle. |
bool | $count | Set to TRUE to return only a count of orphans. |
integer | $offset | For paging of entities set this to the offset within the total count. |
integer | $limit | For paging of entities set this to the total number to return. |
- Returns
- array|integer If $count == FALSE then an array of all entity IDs that are orphaned. If $count == TRUE then a single integer count value is returned.
The documentation for this class was generated from the following file:
- tripal/includes/TripalBundleController.inc