public function findBy(string $schema, string $typeName, array $criteria = []) : array
{
if (!$this->typeExists($schema, $typeName)) {
return [];
}
foreach ($this->storage[$schema][$typeName] as $id => $data) {
if ($this->matchesCriteria($criteria, $data)) {
return $data;
}
}
return [];
}