/** * Description... * * @return void **/ public function createLinkToShop($shopId, RM_User_Object $user = NULL) { if (isNull($user)) { $user = M('Account')->getLoggedUser(); } if (isNull($user)) { throw new Exception('No loggedUser!'); } if (!isNull($obShop = $this->_mapper->_storage('shop')->loadObjectById($shopId))) { $obLink = $this->_mapper->_storage('link')->createObject(); $obLink->shop_id = $shopId; $obLink->user_id = $user->id(); $obLink->name = $obShop->name; $obLink->shop_type = $obShop->type_id; $obLink->street = $obShop->street; $obLink->bld = $obShop->bld; } return $obLink; }
/** * Retrievs list oа shopLinks for this shop * * @return RM_Store_iRequest<RM_Shop_Link> */ public function links() { return $this->_mapper->_storage('link')->getObjectList()->filter('shop_id=?', $this->id()); }