PATH:
home
/
lab2454c
/
.trash
/
core
/
vendor
/
mollie
/
mollie-api-php
/
src
/
Resources
<?php namespace Mollie\Api\Resources; use Mollie\Api\MollieApiClient; class ResourceFactory { /** * Create resource object from Api result * * @param object $apiResult * @param BaseResource $resource * * @return BaseResource */ public static function createFromApiResult($apiResult, BaseResource $resource) { foreach ($apiResult as $property => $value) { $resource->{$property} = $value; } return $resource; } /** * @param MollieApiClient $client * @param string $resourceClass * @param array $data * @param null $_links * @param null $resourceCollectionClass * @return mixed */ public static function createBaseResourceCollection( MollieApiClient $client, $resourceClass, $data, $_links = null, $resourceCollectionClass = null ) { $resourceCollectionClass = $resourceCollectionClass ?: $resourceClass . 'Collection'; $data = $data ?: []; $result = new $resourceCollectionClass(count($data), $_links); foreach ($data as $item) { $result[] = static::createFromApiResult($item, new $resourceClass($client)); } return $result; } /** * @param MollieApiClient $client * @param array $input * @param string $resourceClass * @param null $_links * @param null $resourceCollectionClass * @return mixed */ public static function createCursorResourceCollection( $client, array $input, $resourceClass, $_links = null, $resourceCollectionClass = null ) { if (null === $resourceCollectionClass) { $resourceCollectionClass = $resourceClass.'Collection'; } $data = new $resourceCollectionClass($client, count($input), $_links); foreach ($input as $item) { $data[] = static::createFromApiResult($item, new $resourceClass($client)); } return $data; } }
[-] CurrentProfile.php
[edit]
[-] OrganizationCollection.php
[edit]
[-] SubscriptionCollection.php
[edit]
[+]
..
[-] Permission.php
[edit]
[-] MethodPrice.php
[edit]
[-] Settlement.php
[edit]
[-] CursorCollection.php
[edit]
[-] CustomerCollection.php
[edit]
[-] RefundCollection.php
[edit]
[-] Refund.php
[edit]
[-] CaptureCollection.php
[edit]
[-] Method.php
[edit]
[-] Order.php
[edit]
[-] Subscription.php
[edit]
[-] PaymentLink.php
[edit]
[-] BaseResource.php
[edit]
[-] Onboarding.php
[edit]
[-] BaseCollection.php
[edit]
[-] Customer.php
[edit]
[-] OrderLine.php
[edit]
[-] Profile.php
[edit]
[-] Issuer.php
[edit]
[-] Mandate.php
[edit]
[-] ShipmentCollection.php
[edit]
[-] IssuerCollection.php
[edit]
[-] PermissionCollection.php
[edit]
[-] InvoiceCollection.php
[edit]
[-] Capture.php
[edit]
[-] MethodCollection.php
[edit]
[-] PaymentCollection.php
[edit]
[-] PaymentLinkCollection.php
[edit]
[-] OrderCollection.php
[edit]
[-] ResourceFactory.php
[edit]
[-] MandateCollection.php
[edit]
[-] ChargebackCollection.php
[edit]
[-] Payment.php
[edit]
[-] Organization.php
[edit]
[-] Invoice.php
[edit]
[-] ProfileCollection.php
[edit]
[-] OrderLineCollection.php
[edit]
[-] MethodPriceCollection.php
[edit]
[-] Chargeback.php
[edit]
[-] Shipment.php
[edit]
[-] SettlementCollection.php
[edit]