1. Go to this page and download the library: Download germania-kg/fabrics library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
germania-kg / fabrics example snippets
namespace Germania\Fabrics;
interface FabricsClientInterface
{
/**
* Retrieve all fabrics belonging to the given collection.
*
* @param string $collection URL slug of a Germania Fabrics Collection
* @param string|null $search Optional: search term
* @param string|null $sort Optional: sort by field(s), string or CSV string
* @return iterable|FabricInterface[] Iterable with FabricInterface instances
*/
public function collection( string $collection, string $search = null, string $sort = null) : iterable;
/**
* Retrieves all fabric transparencies belonging to the given collection.
*
* @param string $collection URL slug of a Germania Fabrics Collection
* @return iterable|FabricInterface[] Iterable with FabricInterface instances
*/
public function collectionTransparencies( string $collection) : iterable;
/**
* Retrieves all color groups belonging to the given collection.
*
* @param string $collection URL slug of a Germania Fabrics Collection
* @return iterable|FabricInterface[] Iterable with FabricInterface instances
*/
public function collectionColors( string $collection) : iterable;
/**
* Retrieves a single fabric from a given collection.
*
* @param string $collection URL slug of a Germania Fabrics Collection
* @param string $fabric_number Fabric number
* @return FabricInterface
*/
public function fabric( string $collection, string $fabric_number ) : FabricInterface;
}
use Germania\Fabrics\FabricFactory;
$factory = new FabricFactory;
$fabric = $factory( [
'fabric_number' => "1234",
'collection_slug' => "someCollection"
]);
use MyApp\SepcialFabric;
$factory = new FabricFactory( SepcialFabric::class );
use Germania\Fabrics\Fabric;
use Germania\Fabrics\FabricDecoratorAbstract;
class MyDecorator extends FabricDecoratorAbstract
{
// ...
}
$fabric = new Fabric;
$my_fabric = new MyDecorator( $fabric );
use Germania\Fabrics\PhotoNotEmptyFilterIterator;
use Germania\Fabrics\SameValueFilterIterator,
use Germania\Fabrics\LieferbarFabricsFilterIterator;
use Germania\Fabrics\EnabledFabricsFilterIterator;