PHP Class ScriptFUSION\Porter\Porter

Show file Open project: ScriptFUSION/Porter Class Usage Examples

Public Methods

Method Description
__construct ( )
getProvider ( string $name, string | null $tag = null ) : ScriptFUSION\Porter\Provider\Provider Gets the provider matching the specified class name and optionally a tag.
hasProvider ( string $name, string | null $tag = null ) : boolean Gets a value indicating whether the specified provider is registered.
import ( ImportSpecification $specification ) : PorterRecords Imports data according to the design of the specified import specification.
importOne ( ImportSpecification $specification ) : array | null Imports one record according to the design of the specified import specification.
registerProvider ( ScriptFUSION\Porter\Provider\Provider $provider, string | null $tag = null ) Registers the specified provider optionally identified by the specified tag.
setMapper ( ScriptFUSION\Mapper\CollectionMapper $mapper )

Private Methods

Method Description
applyCacheAdvice ( ScriptFUSION\Porter\Provider\Provider $provider, CacheAdvice $cacheAdvice )
createMappedRecords ( Iterator $records, RecordCollection $previous, ScriptFUSION\Mapper\Mapping $mapping )
createPorterRecords ( RecordCollection $records, ImportSpecification $specification )
createProviderRecords ( Iterator $records, ScriptFUSION\Porter\Provider\Resource\ProviderResource $resource )
fetch ( ScriptFUSION\Porter\Provider\Resource\ProviderResource $resource, CacheAdvice $cacheAdvice = null )
filter ( ProviderRecords $records, callable $predicate, $context )
getOrCreateMapper ( ) : ScriptFUSION\Mapper\CollectionMapper
getOrCreateProviderFactory ( )
hashProviderName ( string $name, string | null $tag ) : string
map ( RecordCollection $records, ScriptFUSION\Mapper\Mapping $mapping, $context )

Method Details

__construct() public method

public __construct ( )

getProvider() public method

Gets the provider matching the specified class name and optionally a tag.
public getProvider ( string $name, string | null $tag = null ) : ScriptFUSION\Porter\Provider\Provider
$name string Provider class name.
$tag string | null Optional. Provider tag.
return ScriptFUSION\Porter\Provider\Provider

hasProvider() public method

Gets a value indicating whether the specified provider is registered.
public hasProvider ( string $name, string | null $tag = null ) : boolean
$name string Provider class name.
$tag string | null Optional. Provider tag.
return boolean True if the specified provider is registered, otherwise false.

import() public method

Imports data according to the design of the specified import specification.
public import ( ImportSpecification $specification ) : PorterRecords
$specification ScriptFUSION\Porter\Specification\ImportSpecification Import specification.
return ScriptFUSION\Porter\Collection\PorterRecords

importOne() public method

Imports one record according to the design of the specified import specification.
public importOne ( ImportSpecification $specification ) : array | null
$specification ScriptFUSION\Porter\Specification\ImportSpecification Import specification.
return array | null Record.

registerProvider() public method

Registers the specified provider optionally identified by the specified tag.
public registerProvider ( ScriptFUSION\Porter\Provider\Provider $provider, string | null $tag = null )
$provider ScriptFUSION\Porter\Provider\Provider Provider.
$tag string | null Optional. Provider tag.

setMapper() public method

public setMapper ( ScriptFUSION\Mapper\CollectionMapper $mapper )
$mapper ScriptFUSION\Mapper\CollectionMapper