src/ShopWishlistBundle/pkgExtranet/objects/db/TShopWishlistDataExtranetUser.class.php
public function &GetWishlist($bCreateIfNotExists = false)
    {
        $oWishlist = &$this->GetFromInternalCache('oUserWishlist');
        if (is_null($oWishlist)) {
            $oWishlists = $this->GetFieldPkgShopWishlistList();
            if ($oWishlists->Length() > 0) {
                $oWishlist = $oWishlists->Current();
            }
            if (is_null($oWishlist) && $bCreateIfNotExists) {
                $oWishlist = TdbPkgShopWishlist::GetNewInstance();
                /** @var $oWishlist TdbPkgShopWishlist */
                if (!$oWishlist->LoadFromField('data_extranet_user_id', $this->id)) {
                    $aBaseData = array('data_extranet_user_id' => $this->id, 'is_public' => '0');
                    $oWishlist->LoadFromRow($aBaseData);
                    $oWishlist->Save();
                }
            }
            $this->SetInternalCache('oUserWishlist', $oWishlist);
        }

        return $oWishlist;
    }
public function &GetWishlist($bCreateIfNotExists = false)
    {
        $oWishlist = &$this->GetFromInternalCache('oUserWishlist');
        if (is_null($oWishlist)) {
            $oWishlists = $this->GetFieldPkgShopWishlistList();
            if ($oWishlists->Length() > 0) {
                $oWishlist = $oWishlists->Current();
            }
            if (is_null($oWishlist) && $bCreateIfNotExists) {
                $oWishlist = TdbPkgShopWishlist::GetNewInstance();
                /** @var $oWishlist TdbPkgShopWishlist */
                if (!$oWishlist->LoadFromField('data_extranet_user_id', $this->id)) {
                    $aBaseData = array('data_extranet_user_id' => $this->id, 'is_public' => '0');
                    $oWishlist->LoadFromRow($aBaseData);
                    $oWishlist->Save();
                }
            }
            $this->SetInternalCache('oUserWishlist', $oWishlist);
        }

        return $oWishlist;
    }
public function & GetWishlist ( $ bCreateIfNotExists = false ) { $ oWishlist = & $ this -> GetFromInternalCache ( 'oUserWishlist' ) ; if ( is_null ( $ oWishlist ) ) { $ oWishlists = $ this -> GetFieldPkgShopWishlistList ( ) ; if ( $ oWishlists -> Length ( ) > 0 ) { $ oWishlist = $ oWishlists -> Current ( ) ; } if ( is_null ( $ oWishlist ) && $ bCreateIfNotExists ) { $ oWishlist = TdbPkgShopWishlist :: GetNewInstance ( ) ; /** @var $oWishlist TdbPkgShopWishlist */ if ( ! $ oWishlist -> LoadFromField ( 'data_extranet_user_id' , $ this -> id ) ) { $ aBaseData = array ( 'data_extranet_user_id' => $ this -> id , 'is_public' => '0' ) ; $ oWishlist -> LoadFromRow ( $ aBaseData ) ; $ oWishlist -> Save ( ) ; } } $ this -> SetInternalCache ( 'oUserWishlist' , $ oWishlist ) ; } return $ oWishlist ; }
return the users wishlist. if no wishlist exists, the method will return
null - unless the option bCreateIfNotExists is set, then we will
create a new on.

@param bool $bCreateIfNotExists

@return TdbPkgShopWishlist
return the users wishlist . if no wishlist exists the method will return null - unless the option bCreateIfNotExists is set then we will create a new on .