Gets the PClass by ID.

@param int $id      PClass ID.
@param int $eid     Merchant ID.
@param int $country {@link KlarnaCountry Country} constant.

@throws KlarnaException
@return KlarnaPClass
556428
public function getPClass($id, $eid, $country)
    {
        if (!is_int($id)) {
            throw new InvalidArgumentException('Supplied ID is not an integer!');
        }

        if (!is_array($this->pclasses)) {
            throw new Klarna_PClassException('No match for that eid!');
        }

        if (!isset($this->pclasses[$eid]) || !is_array($this->pclasses[$eid])) {
            throw new Klarna_PClassException('No match for that eid!');
        }

        if (!isset($this->pclasses[$eid][$id])
            || !$this->pclasses[$eid][$id]->isValid()
        ) {
            throw new Klarna_PClassException('No such pclass available!');
        }

        if ($this->pclasses[$eid][$id]->getCountry() !== $country) {
            throw new Klarna_PClassException(
                'You cannot use this pclass with set country!'
            );
        }

        return $this->pclasses[$eid][$id];
    }
1223934
public static function getInstanceFromDataRow(array $row, $languageId = null)
    {
        $className = $row['class'];
        /**
         * @var $instance TdbShopPaymentHandler
         */
        $instance = new $className();
        if (null !== $languageId) {
            $instance->SetLanguage($languageId);
        }
        $instance->LoadFromRow($row);

        return $instance;
    }
283034
public function GetForeignID($ForeignID, $Type = '') {
      $Hash = ForeignIDHash($ForeignID);
      $Session = Gdn::Session();
      $this->FireEvent('BeforeGetForeignID');
      $this->SQL
         ->Select('d.*')
         ->Select('ca.Name', '', 'Category')
         ->Select('ca.UrlCode', '', 'CategoryUrlCode')
         ->Select('ca.PermissionCategoryID')
         ->Select('w.DateLastViewed, w.Dismissed, w.Bookmarked')
         ->Select('w.CountComments', '', 'CountCommentWatch')
         ->Select('d.DateLastComment', '', 'LastDate')
         ->Select('d.LastCommentUserID', '', 'LastUserID')
         ->Select('lcu.Name', '', 'LastName')
			->Select('iu.Name', '', 'InsertName')
			->Select('iu.Photo', '', 'InsertPhoto')
         ->From('Discussion d')
         ->Join('Category ca', 'd.CategoryID = ca.CategoryID', 'left')
         ->Join('UserDiscussion w', 'd.DiscussionID = w.DiscussionID and w.UserID = '.$Session->UserID, 'left')
			->Join('User iu', 'd.InsertUserID = iu.UserID', 'left') // Insert user
			->Join('Comment lc', 'd.LastCommentID = lc.CommentID', 'left') // Last comment
         ->Join('User lcu', 'lc.InsertUserID = lcu.UserID', 'left') // Last comment user
         ->Where('d.ForeignID', $Hash);
		
		if ($Type != '')
			$this->SQL->Where('d.Type', $Type);
			
		$Discussion = $this->SQL
         ->Get()
         ->FirstRow();
      
      if (C('Vanilla.Views.Denormalize', FALSE))
         $this->AddDenormalizedViews($Discussion);
              
      return $Discussion;
   }
165470
public static function getByIdType($id, $type)
    {
        $o = self::factory($type);
		$o->load($id);
        return $o;
    }
415707
public function getById($id, $col = null)
    {
        $id = (int) $id;
        $model = $this->getCacheItem($id);

        if (!$model) {
            $model = $this->getMapper()->getById($id, $col);

            if ($this->useCache) {
                $this->setCacheItem($id, $model);
            }
        }

        return $model;
    }
51985
public static function getById($paymentId, $apiContext = null)
    {
        if (isset($apiContext)) {
            return Payment::get($paymentId, $apiContext);
        }
        return Payment::get($paymentId);
    }
198570
public static Class<? extends Tag> getClassFor(int id) {
        if(!idToTag.containsKey(id)) {
            return null;
        }

        return idToTag.get(id);
    }
360198
public function getInfoAction($actorId, $id)
    {
        $em = $this->getDoctrine()->getManager();

        /** @var Address $entity */
        $entity = $em->getRepository('EcommerceBundle:Address')->findOneById($id);

        $addressResponse = new stdClass();
        $addressResponse->id = $entity->getId();
        $addressResponse->address = $entity->getAddress();
        $addressResponse->dni = $entity->getDni();
        $addressResponse->city = $entity->getCity();
        $addressResponse->state = $entity->getState()->getId();
        $addressResponse->country = $entity->getCountry()->getId();
        $addressResponse->phone = $entity->getPhone();
        $addressResponse->phone2 = $entity->getPhone2();
        $addressResponse->postalCode = $entity->getPostalCode();
        $addressResponse->preferredSchedule = $entity->getPreferredSchedule();
        
        return new JsonResponse($addressResponse);
    }
380573
public function getProductByIdAndStore($id, $storeId)
    {
        $product = $this->productFactory->create()
            ->getCollection()
            ->addIdFilter($id)
            ->setStoreId($storeId)
            ->addAttributeToSelect(
                ['product_url', 'name', 'store_id', 'small_image']
            )
            ->setPage(1, 1);

        return $product->getFirstItem();
    }
1138855
public function accountsChartsTypesByCountry($id)
  {
    return $this->AccountChartType->where(function($query) use ($id)
      {
        $query->orWhere('country_id', '=', $id);
        $query->orWhereNull('country_id');
      })->get();
  }
1198340
@Override
	public List<CommerceAddress> findByCommerceCountryId(long commerceCountryId) {
		return findByCommerceCountryId(commerceCountryId, QueryUtil.ALL_POS,
			QueryUtil.ALL_POS, null);
	}
134578
public function getPayment($userId, $monetaryAccountId, $id)
    {
        $paymentResponse = $this->client->get($this->getResourceEndpoint($userId, $monetaryAccountId) . '/' . (int)$id);

        $payment = $paymentResponse['Response'][0]['Payment'];

        $payment['amount']['value'] = $this->floatToCents($payment['amount']['value']);

        return $payment;
    }
1331325
public function getCountry($id)
    {
        foreach ($this->data as $country) {
            if (strtoupper($id) == (string) $country) {
                return $country;
            }
        }

        return null;
    }
656736
public function getCurrencyForCountry($country = null)
    {
        if ($country === null) {
            $country = $this->_country;
        }
        return KlarnaCountry::getCurrency($country);
    }
273057
public function getOneById($id)
    {
        $plugin = $this->getById($id);
        if (!$plugin) {
            throw new Exception(sprintf('Plugin "%s" not found', $id));
        }

        return $plugin;
    }
651725
@Override
	public List<CommerceCountry> getCommerceCountriesByUuidAndCompanyId(
		String uuid, long companyId) {
		return commerceCountryPersistence.findByUuid_C(uuid, companyId);
	}
835349
public function getContextObjectWithIDAndClass($id, $className) {
		$result = null;
		if ($id && $className) {
			$prevMode = Versioned::get_reading_mode();
			Versioned::set_reading_mode("Stage.Stage");

			$result = DataObject::get_by_id($className, $id);

			Versioned::set_reading_mode($prevMode);
		}
		return $result;
	}