/** * Share mapper connection with relation * * @param $relation * @return mixed */ private function prepareRelation(RelationInterface $relation) { if ($relation instanceof ConnectionAwareInterface) { $relation->setConnection($this->getConnection()); } return $relation; }