| 1 | <?php |
||
| 8 | class RelationshipIterator |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * The primary record. |
||
| 12 | */ |
||
| 13 | private $record; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * The path to the relation. |
||
| 17 | * |
||
| 18 | * @var string |
||
| 19 | */ |
||
| 20 | private $path; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Create a new RelationshipIterator instance. |
||
| 24 | * |
||
| 25 | * @param Model $record The primary record |
||
| 26 | * @param string $path The path to the relation |
||
| 27 | */ |
||
| 28 | public function __construct($record, $path) |
||
| 37 | |||
| 38 | /** |
||
| 39 | * Resolve the relationship from the primary record. |
||
| 40 | * |
||
| 41 | * @throws InvalidRelationPathException |
||
| 42 | * |
||
| 43 | * @return Collection|Model|null |
||
| 44 | */ |
||
| 45 | public function resolve() |
||
| 55 | } |
||
| 56 |