src/Repository/ElasticsearchRepository.php 1 location
|
@@ 28-35 (lines=8) @@
|
25 |
|
$this->client = $client; |
26 |
|
} |
27 |
|
|
28 |
|
public function instantiate(string $class): Storable |
29 |
|
{ |
30 |
|
$instance = new $class; |
31 |
|
if (!$instance instanceof IElasticsearchModel) { |
32 |
|
throw new ClassTypeErrorException(IElasticsearchModel::class); |
33 |
|
} |
34 |
|
return $instance; |
35 |
|
} |
36 |
|
|
37 |
|
protected function fill(Storable $model, ElasticsearchItemResponse $response) |
38 |
|
{ |
src/Repository/RuntimeCacheRepository.php 1 location
|
@@ 25-32 (lines=8) @@
|
22 |
|
return $class . '@' . $id; |
23 |
|
} |
24 |
|
|
25 |
|
public function instantiate(string $class): Storable |
26 |
|
{ |
27 |
|
$instance = new $class; |
28 |
|
if (!$instance instanceof IEloquent) { |
29 |
|
throw new ClassTypeErrorException(IEloquent::class); |
30 |
|
} |
31 |
|
return $instance; |
32 |
|
} |
33 |
|
|
34 |
|
public function find($id, string $class, array $columns = []): Storable |
35 |
|
{ |