PHP Class Sonata\Component\Product\Pool

显示文件 Open project: sonata-project/ecommerce Class Usage Examples

Protected Properties

Property Type Description
$products array

Public Methods

Method Description
addProduct ( string $code, ProductDefinition $productDescription ) add a delivery method into the pool.
getManager ( Sonata\Component\Product\ProductInterface | string $code ) : Sonata\Component\Product\ProductManagerInterface
getProduct ( string $code ) : ProductDefinition
getProductCode ( Sonata\Component\Product\ProductInterface $product ) : integer | null | string
getProducts ( ) : array
getProvider ( Sonata\Component\Product\ProductInterface | string $code ) : Sonata\Component\Product\ProductProviderInterface
hasProduct ( string $code ) : boolean Tells if a product with $code is in the pool.
hasProvider ( string $code ) : boolean

Method Details

addProduct() public method

add a delivery method into the pool.
public addProduct ( string $code, ProductDefinition $productDescription )
$code string
$productDescription ProductDefinition

getManager() public method

public getManager ( Sonata\Component\Product\ProductInterface | string $code ) : Sonata\Component\Product\ProductManagerInterface
$code Sonata\Component\Product\ProductInterface | string
return Sonata\Component\Product\ProductManagerInterface

getProduct() public method

public getProduct ( string $code ) : ProductDefinition
$code string
return ProductDefinition

getProductCode() public method

public getProductCode ( Sonata\Component\Product\ProductInterface $product ) : integer | null | string
$product Sonata\Component\Product\ProductInterface
return integer | null | string

getProducts() public method

public getProducts ( ) : array
return array

getProvider() public method

public getProvider ( Sonata\Component\Product\ProductInterface | string $code ) : Sonata\Component\Product\ProductProviderInterface
$code Sonata\Component\Product\ProductInterface | string
return Sonata\Component\Product\ProductProviderInterface

hasProduct() public method

Tells if a product with $code is in the pool.
public hasProduct ( string $code ) : boolean
$code string
return boolean

hasProvider() public method

public hasProvider ( string $code ) : boolean
$code string
return boolean

Property Details

$products protected_oe property

protected array $products
return array