1: <?php
2:
3: /**
4: * Deep
5: *
6: * @package rsanchez\Deep
7: * @author Rob Sanchez <info@robsanchez.com>
8: */
9:
10: namespace rsanchez\Deep\Hydrator;
11:
12: use rsanchez\Deep\Model\AbstractEntity;
13: use rsanchez\Deep\Model\AbstractProperty;
14:
15: /**
16: * Hydrator interface
17: *
18: * Hydrators bind custom fields properties to Entry objects
19: */
20: interface HydratorInterface
21: {
22: /**
23: * Preload any custom field data that resides in another DB table
24: * @param array $entryIds all the entry IDs in the collection (including related entries)
25: * @return void
26: */
27: public function preload(array $entryIds);
28:
29: /**
30: * Hydrate the specified property (channel field or Matrix/Grid col)
31: * on the specified entity (channel entry or Matrix/Grid row)
32: *
33: * @param AbstractEntity $entity
34: * @param AbstractProperty $property
35: * @return mixed the entity property value
36: */
37: public function hydrate(AbstractEntity $entity, AbstractProperty $property);
38: }
39: