You are here

public function BiblioStyleBase::isDuplicate in Bibliography Module 7.3

Searches for a biblio object identical to the given one.

Parameters

$biblio: Biblio object.

Return value

The duplicate Biblio object, FALSE if not found.

1 call to BiblioStyleBase::isDuplicate()
BiblioStyleBase::saveOrFindDuplicateFromImportData in plugins/biblio_style/abstract.inc
Given a of successful import, find duplicates or save the new Biblios.

File

plugins/biblio_style/abstract.inc, line 151

Class

BiblioStyleBase
An abstract implementation of MessageNotifierInterface.

Code

public function isDuplicate(Biblio $biblio) {
  $md5 = $this
    ->generateBiblioMd5($biblio);
  $query = new EntityFieldQuery();
  $result = $query
    ->entityCondition('entity_type', 'biblio')
    ->propertyCondition('md5', $md5)
    ->range(0, 1)
    ->execute();
  if (empty($result['biblio'])) {
    return;
  }
  $row = reset($result['biblio']);
  $biblio = biblio_load($row->bid);
  return $biblio;
}