1: <?php
2:
3: namespace vierbergenlars\Forage\ODM;
4:
5: /**
6: * Interface for settings for the hydration of search results in objects
7: */
8: interface HydrationSettingsInterface
9: {
10: /**
11: * Gets the document from an object
12: * @param object $document
13: * @return array The document to be stored in the database
14: */
15: public function getDocument($document);
16:
17: /**
18: * Gets the id of the document from the object
19: * @param object $document
20: * @return string|int The id of the document to be stored in the database
21: */
22: public function getDocumentId($document);
23:
24: /**
25: * Gets the object from a document
26: * @param array $document
27: * @return SearchHit
28: */
29: public function getObject(SearchHit $document);
30: }
31: