Fix the UniqueCollection fetcher

This commit is contained in:
Damien Alexandre
2014-10-07 11:05:14 +02:00
parent 5f7edb5be9
commit b15fade0fe

View File

@@ -32,7 +32,16 @@ class RecordHelper
public function getUniqueCollectionId($databoxId, $collectionId)
{
return igorw\get_in($this->collectionMap(), [$databoxId, $collectionId]);
$col = $this->collectionMap();
if (isset($col[$databoxId])) {
$index = array_search($collectionId, $col[$databoxId]);
if ($index !== false) {
return (int) $index;
}
}
return null;
}
private function collectionMap()