Tripal
Public Member Functions | List of all members
TripalBundleController Class Reference
Inheritance diagram for TripalBundleController:
Inheritance graph
[legend]
Collaboration diagram for TripalBundleController:
Collaboration graph
[legend]

Public Member Functions

 __construct ($entityType)
 
 create (array $values=[])
 
 delete ($ids, DatabaseTransaction $transaction=NULL)
 
 findOrphans ($id, $count=FALSE, $offset=0, $limit=0)
 
 findAllOrphans ($count=FALSE, $offset=0, $limit=0)
 
 deleteOrphans (int $id, TripalJob $job=NULL)
 
 deleteAllOrphans (TripalJob $job=NULL)
 

Detailed Description

The Controller for Tripal data type entities

Member Function Documentation

◆ 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
$typeThe 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$jobAn 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$idThe ID of the bundle.
TripalJob$jobAn 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$countSet to TRUE to return only a count of orphans.
integer$offsetFor paging of entities set this to the offset within the total count.
integer$limitFor 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$idThe ID of the bundle.
bool$countSet to TRUE to return only a count of orphans.
integer$offsetFor paging of entities set this to the offset within the total count.
integer$limitFor 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: