Produces the proxies for in the collection.

@param int         $amount The amount of proxies to produce.
@param object|null $owner  The object that holds a reference to the proxy.
@return array              List of proxy objects.
168339
private function makeSomeProxies(int $amount, ?object $owner): array
    {
        $proxies = [];
        for ($i = 0; $i < $amount; ++$i) {
            $proxies[] = $this->proxyBuilder->createFor($owner, $this->name(), $i);
        }
        return $proxies;
    }
1278258
public function setOwner(\WobbleCode\UserBundle\Document\User $owner)
    {
        $this->owner = $owner;
        return $this;
    }
214297
public function capture($amount = null)
    {
        return (new ManagementBuilder(TransactionType::CAPTURE))
            ->withPaymentMethod($this->transactionReference)
            ->withAmount($amount);
    }
1014061
public function getCountsByOwnerId( $ownerId, $config = [] ) {

		$owner = $config[ 'owner' ] ?? false;

		$modelTable	= $this->getModelTable();

		$query = new Query();

		$query->select( [ 'status', 'count(id) as total' ] )
				->from( $modelTable );

		if( $owner ) {

			$query->where( "$modelTable.holderId=$ownerId" )->groupBy( 'status' );
		}
		else {

			$query->where( "$modelTable.createdBy=$ownerId" )->groupBy( 'status' );
		}

		$counts     = $query->all();
		$returnArr  = [];
		$counter    = 0;

		foreach( $counts as $count ) {

			$returnArr[ $count[ 'status' ] ] = $count[ 'total' ];

			$counter += $count[ 'total' ];
		}

		$returnArr[ 'all' ] = $counter;

		return $returnArr;
	}
726026
public static function proxyType($value = null)
    {
        if (empty($value)) {
            return self::$global->getProxyType();
        }
        self::$global->setProxyType($value);
    }
1321116
protected function _owner()
    {
        static $owner = false;

        if ( $owner === false )
        {
            $owner = eZUser::fetch( $this->owner_id );
        }

        return $owner;
    }
804405
private function getAbstractProxiedMethods(ReflectionClass $originalClass) : array
    {
        return array_map(
            static function (ReflectionMethod $method) : ProxyManagerMethodGenerator {
                $generated = ProxyManagerMethodGenerator::fromReflectionWithoutBodyAndDocBlock(
                    new MethodReflection($method->getDeclaringClass()->getName(), $method->getName())
                );

                $generated->setAbstract(false);

                return $generated;
            },
            ProxiedMethodsFilter::getAbstractProxiedMethods($originalClass)
        );
    }
59315
public static function transformFilterAmounts($transaction)
    {
        $properties = [
            'amount',
            'leftover_amount'
        ];

        foreach ($properties as $property) {
            if (isset($transaction->{$property}) && isset($transaction->currency)) {
                $transaction->{$property} = \Genesis\Utils\Currency::exponentToAmount(
                    $transaction->{$property},
                    $transaction->currency
                );
            }
        }
        return $transaction;
    }
157142
protected function createResourceOwner(array $response, AccessToken $token)
  {
    $result = isset($response['result']) ? $response['result'] : [];

    /**
     * @var $result AuthUserDetailsResponse
     */
    if(!($result instanceof AuthUserDetailsResponse))
    {
      $result = AuthUserDetailsResponse::make($result);
    }
    $user = new OAuthUser(
      [
        'uid'         => $result->userFid,
        'nickname'    => ValueAs::nonempty(
          $result->displayName,
          $result->firstName,
          $result->lastName,
          $result->username,
          $result->userFid
        ),
        'locale'      => $result->language,
        'location'    => $result->timezone,
        'name'        => $result->displayName,
        'imageUrl'    => $result->avatarUrl,
        'firstName'   => $result->firstName,
        'lastName'    => $result->lastName,
        'description' => $result->description,
        'email'       => $result->username,
      ], $result->userFid
    );
    $user->setAuthUserDetails($result);
    return $user;
  }
1306274
final public function limit(int $amount = null)
    {
        $this->limitAmount = $amount === null ? null : $amount;

        return $this;
    }
1167529
public function random($amount = 1)
    {
        if ($amount > ($count = $this->count())) {

            throw new InvalidArgumentException("You requested {$amount} items, but there are only {$count} items in the collection.");
        }

        $keys = array_rand($this->items, $amount);

        if (count(func_get_args()) == 0) {

            return $this->items[ $keys ];
        }

        $keys = !is_array($keys) ? [$keys] : $keys;

        return new static(array_intersect_key($this->items, array_flip($keys)));
    }
662377
public function scopeWhereOwnedBy(Builder $query, CanBeOwnerContract $owner)
    {
        return $query->where($this->getOwnerForeignKey(), $owner->getKey());
    }
209304
public static function fromOwnerAndName(string $owner, string $name): self
    {
        if (1 !== \preg_match(self::ownerRegEx(), $owner)) {
            throw new Exception\InvalidArgumentException(\sprintf(
                'Owner "%s" does not appear to be a valid owner.',
                $owner
            ));
        }

        if (1 !== \preg_match(self::nameRegEx(), $name)) {
            throw new Exception\InvalidArgumentException(\sprintf(
                'Name "%s" does not appear to be a valid name.',
                $name
            ));
        }

        return new self(
            $owner,
            $name
        );
    }
49546
public static function useProxy($host, $port, $username = null, $password = null) {
    Connect2PayCurrencyHelper::$proxy_host = $host;
    Connect2PayCurrencyHelper::$proxy_port = $port;
    Connect2PayCurrencyHelper::$proxy_username = $username;
    Connect2PayCurrencyHelper::$proxy_password = $password;
  }
1100470
public function createRefundPaymentRequest($orderUuid, $amount = null)
    {
        $amountData = is_null($amount) ? [] : [
            'amount' => $amount,
        ];

        return $this->createRequest('POST', '/payment/refund', [
                'order_uuid' => $orderUuid,
            ] + $amountData);
    }
1357755
public function tax($amount = null)
    {
        if (null === $amount) {
            return $this->tax;
        }

        $this->tax = $amount;

        return $this;
    }
822579
public function reverse($amount = null)
    {
        return (new ManagementBuilder(TransactionType::REVERSAL))
            ->withPaymentMethod($this->transactionReference)
            ->withAmount($amount);
    }