| @@ 164-173 (lines=10) @@ | ||
| 161 | * @return string |
|
| 162 | * @throws MappingException |
|
| 163 | */ |
|
| 164 | public function getKeyFromModel($modelName) |
|
| 165 | { |
|
| 166 | foreach ($this->mapping as $mapping) { |
|
| 167 | if ($modelName === $mapping->getModelName()) { |
|
| 168 | return $mapping->getKey(); |
|
| 169 | } |
|
| 170 | } |
|
| 171 | ||
| 172 | throw new MappingException('Model name ' . $modelName . ' not found in mapping'); |
|
| 173 | } |
|
| 174 | ||
| 175 | /** |
|
| 176 | * getClassMetadata for model name |
|
| @@ 182-191 (lines=10) @@ | ||
| 179 | * @access public |
|
| 180 | * @return ClassMetadata |
|
| 181 | */ |
|
| 182 | public function getClassMetadata($modelName) |
|
| 183 | { |
|
| 184 | foreach ($this->mapping as $mapping) { |
|
| 185 | if ($modelName === $mapping->getModelName()) { |
|
| 186 | return $mapping; |
|
| 187 | } |
|
| 188 | } |
|
| 189 | ||
| 190 | throw new MappingException($modelName . ' model is not mapped'); |
|
| 191 | } |
|
| 192 | ||
| 193 | /** |
|
| 194 | * hasClassMetadata |
|