Dumplie\Metadata\Infrastructure\InMemory\InMemoryStorage::findBy PHP Method

findBy() public method

public findBy ( string $schema, string $typeName, array $criteria = [] ) : array
$schema string
$typeName string
$criteria array
return array
    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 [];
    }