PHP Class Sonata\ProductBundle\Entity\ProductManager

Inheritance: extends Sonata\CoreBundle\Model\BaseEntityManager, implements Sonata\Component\Product\ProductManagerInterface
Afficher le fichier Open project: sonata-project/ecommerce

Méthodes publiques

Méthode Description
findEnabledFromIdAndSlug ( integer $id, string $slug ) : Sonata\Component\Product\ProductInterface | null Retrieve an active product from its id and its slug.
findInSameCollections ( $productCollections, $limit = null )
findParentsInSameCollections ( $productCollections, $limit = null )
findProductForCategory ( Sonata\ClassificationBundle\Model\CategoryInterface $category ) : Sonata\Component\Product\ProductInterface | null Returns partial product example (only to get its class) from $category.
findVariations ( Sonata\Component\Product\ProductInterface $product )
getCategoryActiveProductsQueryBuilder ( Sonata\ClassificationBundle\Model\CategoryInterface $category = null, string $filter = null, mixed $option = null ) : Doctrine\ORM\QueryBuilder Returns active products for a given category.
getPager ( array $criteria, $page, $limit = 10, array $sort = [] )
updateStock ( $product, $diff )

Méthodes protégées

Méthode Description
getCategoryProductsQueryBuilder ( Sonata\ClassificationBundle\Model\CategoryInterface $category = null ) : Doctrine\ORM\QueryBuilder Returns QueryBuilder for products.
queryInSameCollections ( array $productCollections, null | integer $limit = null ) : Doctrine\ORM\QueryBuilder

Method Details

findEnabledFromIdAndSlug() public méthode

Retrieve an active product from its id and its slug.
public findEnabledFromIdAndSlug ( integer $id, string $slug ) : Sonata\Component\Product\ProductInterface | null
$id integer
$slug string
Résultat Sonata\Component\Product\ProductInterface | null

findInSameCollections() public méthode

public findInSameCollections ( $productCollections, $limit = null )

findParentsInSameCollections() public méthode

public findParentsInSameCollections ( $productCollections, $limit = null )

findProductForCategory() public méthode

Returns partial product example (only to get its class) from $category.
public findProductForCategory ( Sonata\ClassificationBundle\Model\CategoryInterface $category ) : Sonata\Component\Product\ProductInterface | null
$category Sonata\ClassificationBundle\Model\CategoryInterface
Résultat Sonata\Component\Product\ProductInterface | null

findVariations() public méthode

public findVariations ( Sonata\Component\Product\ProductInterface $product )
$product Sonata\Component\Product\ProductInterface

getCategoryActiveProductsQueryBuilder() public méthode

Returns active products for a given category.
public getCategoryActiveProductsQueryBuilder ( Sonata\ClassificationBundle\Model\CategoryInterface $category = null, string $filter = null, mixed $option = null ) : Doctrine\ORM\QueryBuilder
$category Sonata\ClassificationBundle\Model\CategoryInterface
$filter string
$option mixed
Résultat Doctrine\ORM\QueryBuilder

getCategoryProductsQueryBuilder() protected méthode

Returns QueryBuilder for products.
protected getCategoryProductsQueryBuilder ( Sonata\ClassificationBundle\Model\CategoryInterface $category = null ) : Doctrine\ORM\QueryBuilder
$category Sonata\ClassificationBundle\Model\CategoryInterface
Résultat Doctrine\ORM\QueryBuilder

getPager() public méthode

public getPager ( array $criteria, $page, $limit = 10, array $sort = [] )
$criteria array
$sort array

queryInSameCollections() protected méthode

protected queryInSameCollections ( array $productCollections, null | integer $limit = null ) : Doctrine\ORM\QueryBuilder
$productCollections array
$limit null | integer
Résultat Doctrine\ORM\QueryBuilder

updateStock() public méthode

public updateStock ( $product, $diff )