| 1 | <?php |
||
| 8 | abstract class AbstractTransformer implements TransformerInterface |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @param object $entity |
||
| 12 | */ |
||
| 13 | private function validateEntityClass($entity) |
||
| 19 | |||
| 20 | /** |
||
| 21 | * {@inheritdoc} |
||
| 22 | */ |
||
| 23 | public function transformToDocuments($entity) |
||
| 35 | |||
| 36 | /** |
||
| 37 | * {@inheritdoc} |
||
| 38 | */ |
||
| 39 | public function transformToIds($entity) |
||
| 51 | |||
| 52 | /** |
||
| 53 | * Implement this method returning either a Document or an array of Document objects. |
||
| 54 | * |
||
| 55 | * You do not need to check the class of $entity as this is already handled. |
||
| 56 | * |
||
| 57 | * @param object $entity |
||
| 58 | * @return Document[]|Document |
||
| 59 | */ |
||
| 60 | abstract protected function handleTransformToDocuments($entity); |
||
| 61 | |||
| 62 | /** |
||
| 63 | * Implement this method returning either a single id or an array of ids. |
||
| 64 | * |
||
| 65 | * You do not need to check the class of $entity as this is already handled. |
||
| 66 | * |
||
| 67 | * @param object $entity |
||
| 68 | * @return string|int|string[]|int[] |
||
| 69 | */ |
||
| 70 | abstract protected function handleTransformToIds($entity); |
||
| 71 | } |
||
| 72 |