1: <?php
2:
3: namespace Alchemy\orm;
4:
5:
6: /**
7: * This is the child side of the standard foreign key system
8: */
9: class ManyToOne extends Relationship {
10:
11: public function getRemoteColumnMap($origin) {
12: $map = $this->getForeignKey()->getNameMap();
13:
14: foreach ($map as $remote => &$local) {
15: $local = $origin->{$local};
16: }
17:
18: return $map;
19: }
20:
21:
22: public function set($origin, $parent) {
23: $this->assertDestinationType($parent);
24:
25: return $parent->cascadeForeignKey($origin, $this->getInverse());
26: }
27: }
28: