|
@@ 88-99 (lines=12) @@
|
| 85 |
|
* @param string $className the class name of an entity (`Post::class`) |
| 86 |
|
* @return InputObjectType |
| 87 |
|
*/ |
| 88 |
|
public function getInput(string $className): InputObjectType |
| 89 |
|
{ |
| 90 |
|
$this->throwIfNotEntity($className); |
| 91 |
|
$key = Utils::getInputTypeName($className); |
| 92 |
|
|
| 93 |
|
if (!isset($this->types[$key])) { |
| 94 |
|
$instance = $this->inputTypeFactory->create($className); |
| 95 |
|
$this->registerInstance($key, $instance); |
| 96 |
|
} |
| 97 |
|
|
| 98 |
|
return $this->types[$key]; |
| 99 |
|
} |
| 100 |
|
|
| 101 |
|
/** |
| 102 |
|
* Returns an special ID type for the given entity |
|
@@ 111-122 (lines=12) @@
|
| 108 |
|
* @param string $className the class name of an entity (`Post::class`) |
| 109 |
|
* @return EntityIDType |
| 110 |
|
*/ |
| 111 |
|
public function getId(string $className): EntityIDType |
| 112 |
|
{ |
| 113 |
|
$this->throwIfNotEntity($className); |
| 114 |
|
$key = Utils::getIDTypeName($className); |
| 115 |
|
|
| 116 |
|
if (!isset($this->types[$key])) { |
| 117 |
|
$instance = new EntityIDType($this->entityManager, $className); |
| 118 |
|
$this->registerInstance($key, $instance); |
| 119 |
|
} |
| 120 |
|
|
| 121 |
|
return $this->types[$key]; |
| 122 |
|
} |
| 123 |
|
|
| 124 |
|
/** |
| 125 |
|
* Register the given type in our internal registry |