/** * @param LinkOne $link */ public function update(LinkOne $link) { parent::update($link); if ($link->isChanged()) { $path = $link->get()->getChildrenPath(); return $link->getModel()->setPathAndUpdateDescendants($path); } }
/** * @covers ::join */ public function testJoinSoftDelete() { $rel = new BelongsTo('user', Address::getRepo()->getConfig(), 'Harp\\Harp\\Test\\TestModel\\User'); $select = new Select(Address::getRepo()); $rel->join($select, 'Address'); $this->assertEquals('SELECT `Address`.* FROM `Address` JOIN `User` AS `user` ON `user`.`id` = `Address`.`userId` AND `user`.`deletedAt` IS NULL', $select->humanize()); }