Get open orders for Seller

@author Tom Haskins-Vaughan <tom@harvestcloud.com>
@since  2012-05-11
@todo   To be completed

@param  Profile  $seller
337049
public function findOpenForSeller(Profile $seller)
    {
        $qb = $this->getEntityManager()->createQueryBuilder();

        $qb->from('HarvestCloudCoreBundle:Order', 'o')
            ->select('o')
            ->join('o.seller', 's')
            ->orderBy('o.id', 'DESC')
            ->where($qb->expr()->in('o.status_code', Order::getOpenStatusCodes()))
            ->andWhere('s.id = :seller_id')
            ->setParameter('seller_id', $seller->getId())
        ;

        $q = $qb->getQuery();

        return $q->execute();
    }
1022669
public function openTransaction($conn = null, $queryMode = self::WRITE_QUERY)
    {
        $command = $this->invoke('neo.open_transaction', $conn);
        $command->setArguments($queryMode);
        $httpResponse = $command->execute();

        return $this->handleHttpResponse($httpResponse);
    }
1230298
public function profilesByPartnerId($partner_id_customer)
    {
        return $this->performRequest(
            self::METHOD_POST,
            sprintf('/api/reseller/v%d/profiles',self::API_VERSION),
            ["partner_id_customer" => $partner_id_customer]
        );
    }
773869
public function ProfileController_AddProfileTabs_Handler($Sender) {
      if (Gdn::Session()->IsValid()) {
         $Inbox = T('Inbox');
         $InboxHtml = Sprite('SpInbox').' '.$Inbox;
         $InboxLink = '/messages/all';
         
         if (Gdn::Session()->UserID != $Sender->User->UserID) {
            // Accomodate admin access
            if (C('Conversations.Moderation.Allow', FALSE) && Gdn::Session()->CheckPermission('Conversations.Moderation.Manage')) {
               $CountUnread = $Sender->User->CountUnreadConversations;
               $InboxLink .= "?userid={$Sender->User->UserID}";
            } else {
               return;
            }
         } else {
            // Current user
            $CountUnread = Gdn::Session()->User->CountUnreadConversations;
         }
         
         if (is_numeric($CountUnread) && $CountUnread > 0)
            $InboxHtml .= ' <span class="Aside"><span class="Count">'.$CountUnread.'</span></span>';
         $Sender->AddProfileTab($Inbox, $InboxLink, 'Inbox', $InboxHtml);
      }
   }
1080470
private function getCustomerData(UserProfile $profile)
    {
        $customerData = [];
        foreach (['firstName', 'lastName', 'email'] as $field) {
            $data = $profile->{$field};
            $customerData[strtolower($field)] = $data !== null ? $data : '-';
        }
        return $customerData;
    }
1047798
public function findOpenForSeller(Profile $seller)
    {
        $q  = $this->getEntityManager()->createQuery('
                SELECT p
                FROM HarvestCloudCoreBundle:Product p
                WHERE p.seller = :seller
            ')
            ->setParameter('seller', $seller)
        ;

        return $q->getResult();
    }
469069
public function setProfile(\HarvestCloud\CoreBundle\Entity\Profile $profile = null)
    {
        $this->profile = $profile;

        return $this;
    }
100289
public function profileOverview(Request $request, SalesChannelContext $context): Response
    {
        $this->denyAccessUnlessLoggedIn();

        $page = $this->profilePageLoader->load($request, $context);

        return $this->renderStorefront('@Storefront/page/account/profile/index.html.twig', ['page' => $page]);
    }
862903
protected function applyAdapterProfileToExistingProfile($adapter_profile, $profile)
	{
		$attributes = get_object_vars($adapter_profile);

		foreach ($attributes as $k => $v)
		{
			$profile->$k = $v;
		}

		return $profile;
	}
1019694
public function items($profileAlias = null)
    {
        $rawItems = empty($this->items) ? [] : $this->items;
        $items = new CollectionDocJsonItems($rawItems, $this);

        // optionally filter based on profile alias
        if ($profileAlias) {
            $filteredRawItems = [];
            foreach ($items as $idx => $item) {
                if ($item->getProfileAlias() == $profileAlias) {
                    $filteredRawItems[] = $rawItems[$idx];
                }
            }
            $items = new CollectionDocJsonItems($filteredRawItems, $this);
        }
        return $items;
    }
698217
public function get($profileId, $optParams = array()) {
      $params = array('profileId' => $profileId);
      $params = array_merge($params, $optParams);
      $data = $this->__call('get', array($params));
      if ($this->useObjects()) {
        return new UserProfile($data);
      } else {
        return $data;
      }
    }
859367
public function get_profile_fields($field = null, $default = null)
	{
		// collect all meta data
		$profile_fields = array();

		foreach ($this->user->metadata as $metadata)
		{
			if (empty($field))
			{
				$profile_fields[$metadata->key] = $metadata->value;
			}
			elseif ($field == $metadata->key)
			{
				return $metadata->value;
			}
		}

		// return the connected data
		return empty($profile_fields) ? $default : $profile_fields;
	}
713295
public function createOrderForSeller(Profile $seller)
    {
        $order = new Order();
        $order->setSeller($seller);

        // If a Buyer has been assigned to this OrderCollection, then set it on
        // this new Order too
        if ($this->getBuyer()) {
            $order->setBuyer($this->getBuyer());
        }

        $this->addOrder($order);

        return $order;
    }
1332981
public function get_profile_fields($field = null, $default = null)
	{
		if (empty($this->user))
		{
			return false;
		}

		if (isset($this->user['profile_fields']))
		{
			is_array($this->user['profile_fields']) or $this->user['profile_fields'] = (@unserialize($this->user['profile_fields']) ?: array());
		}
		else
		{
			$this->user['profile_fields'] = array();
		}

		return is_null($field) ? $this->user['profile_fields'] : \Arr::get($this->user['profile_fields'], $field, $default);
	}
305437
public function setCustomer(\HarvestCloud\CoreBundle\Entity\Profile $customer = null)
    {
        $this->customer = $customer;

        return $this;
    }
709209
public function updateRecurringPaymentsProfile($data, $id)
    {
        $this->post = $this->setRequestData($data)->merge([
            'PROFILEID' => $id,
        ]);

        return $this->doPayPalRequest('UpdateRecurringPaymentsProfile');
    }
449050
public function getProfile()
    {
        if (!$this->kernel->getContainer()->has('profiler')) {
            return false;
        }

        return $this->kernel->getContainer()->get('profiler')->loadProfileFromResponse($this->response);
    }