You are here

function TMGMTRemoteController::loadByRemoteIdentifier in Translation Management Tool 7

Loads remote mapping entities based on remote identifier.

Parameters

int $remote_identifier_1:

int $remote_identifier_2:

int $remote_identifier_3:

Return value

array Array of TMGMTRemote entities.

File

controller/tmgmt.controller.remote.inc, line 75
Contains the remote controller class.

Class

TMGMTRemoteController
Controller class for the remote job mapping entity.

Code

function loadByRemoteIdentifier($remote_identifier_1 = NULL, $remote_identifier_2 = NULL, $remote_identifier_3 = NULL) {
  $query = new EntityFieldQuery();
  $query
    ->entityCondition('entity_type', 'tmgmt_remote');
  if ($remote_identifier_1 !== NULL) {
    $query
      ->propertyCondition('remote_identifier_1', $remote_identifier_1);
  }
  if ($remote_identifier_2 !== NULL) {
    $query
      ->propertyCondition('remote_identifier_2', $remote_identifier_2);
  }
  if ($remote_identifier_3 !== NULL) {
    $query
      ->propertyCondition('remote_identifier_3', $remote_identifier_3);
  }
  $result = $query
    ->execute();
  if (isset($result['tmgmt_remote'])) {
    return entity_load('tmgmt_remote', array_keys($result['tmgmt_remote']));
  }
  return array();
}