You are here

public function PartyDefaultDataSet::getEntityIds in Party 7

Same name and namespace in other branches
  1. 8.2 includes/party.data.inc \PartyDefaultDataSet::getEntityIds()

Get entity ids/deltas

This allows you to get the entity ids and deltas of all the entities without having to load them. There may also be sub entities, in which case the value for that delta will be an empty string, as to not throw a warning if the array is flipped.

Return value

array Array of entity ids keyed by delta. Unsaved entities return an empty string.

2 calls to PartyDefaultDataSet::getEntityIds()
PartyDefaultDataSet::getActions in includes/party.data.inc
Get actions for the attached entity. Check party access in each case.
PartyDefaultDataSet::getEntityDelta in includes/party.data.inc
Get the delta from an entity object.

File

includes/party.data.inc, line 449
Provides the default class for managing party - Attached entity relationships.

Class

PartyDefaultDataSet
Class PartyDefaultDataSet

Code

public function getEntityIds() {
  $ids = array();
  foreach ($this->entities as $delta => $entity) {
    if (!isset($entity->is_new)) {
      $ids[$delta] = $entity->{$this
        ->getDataInfo('id key')};
    }
    else {

      // This is unsaved, so we use an empty string so warnings don't get
      // emitted on an array_flip().
      $ids[$delta] = '';
    }
  }
  return $ids;
}