PHP Class Newscoop\Package\PackageService

ファイルを表示 Open project: sourcefabric/newscoop

Protected Properties

Property Type Description
$imageService Newscoop\Image\ImageService
$orm Doctrine\ORM\EntityManager
$repository Doctrine\ORM\EntityRepository

Public Methods

Method Description
__construct ( EntityManager $orm, ImageService $imageService )
addItem ( Package $package, mixed $item ) : Newscoop\Package\Item Add package item
delete ( integer $id ) : void Delete package
find ( integer $id ) : Newscoop\Package\Package Find package
findAvailableForArticle ( integer $articleNumber ) : array Find packages not attached to article
findBy ( array $criteria, array $orderBy = [], integer $limit = 25, integer $offset ) : array Find package by a set of criteria
findByArticle ( integer $articleNumber ) : array Find packages by article
findBySlug ( string $slug ) : Newscoop\Package\Package Find package by slug
findItem ( integer $id ) : Newscoop\Package\Item Find item by given id
getCountBy ( array $criteria = [] ) : integer Get count by a set of criteria
removeFromArticle ( Package $package, integer $articleNumber ) : void Remove package from article
removeItem ( Package $package, integer $itemId ) : void Remove item from package
save ( array $values, Package $package = null ) : Newscoop\Package\Package Save package
saveArticle ( array $articleArray ) : void Save article packages
saveItem ( array $values, Item $item ) : void Save item
setOrder ( Package $package, array $order ) : void Set order of items for given package

Private Methods

Method Description
getArticle ( integer $articleNumber ) : Newscoop\Package\Article Get article entity

Method Details

__construct() public method

public __construct ( EntityManager $orm, ImageService $imageService )
$orm Doctrine\ORM\EntityManager
$imageService Newscoop\Image\ImageService

addItem() public method

Add package item
public addItem ( Package $package, mixed $item ) : Newscoop\Package\Item
$package Package
$item mixed
return Newscoop\Package\Item

delete() public method

Delete package
public delete ( integer $id ) : void
$id integer
return void

find() public method

Find package
public find ( integer $id ) : Newscoop\Package\Package
$id integer
return Newscoop\Package\Package

findAvailableForArticle() public method

Find packages not attached to article
public findAvailableForArticle ( integer $articleNumber ) : array
$articleNumber integer
return array

findBy() public method

Find package by a set of criteria
public findBy ( array $criteria, array $orderBy = [], integer $limit = 25, integer $offset ) : array
$criteria array
$orderBy array
$limit integer
$offset integer
return array

findByArticle() public method

Find packages by article
public findByArticle ( integer $articleNumber ) : array
$articleNumber integer
return array

findBySlug() public method

Find package by slug
public findBySlug ( string $slug ) : Newscoop\Package\Package
$slug string
return Newscoop\Package\Package

findItem() public method

Find item by given id
public findItem ( integer $id ) : Newscoop\Package\Item
$id integer
return Newscoop\Package\Item

getCountBy() public method

Get count by a set of criteria
public getCountBy ( array $criteria = [] ) : integer
$criteria array
return integer

removeFromArticle() public method

Remove package from article
public removeFromArticle ( Package $package, integer $articleNumber ) : void
$package Package
$articleNumber integer
return void

removeItem() public method

Remove item from package
public removeItem ( Package $package, integer $itemId ) : void
$package Package
$itemId integer
return void

save() public method

Save package
public save ( array $values, Package $package = null ) : Newscoop\Package\Package
$values array
$package Package
return Newscoop\Package\Package

saveArticle() public method

Save article packages
public saveArticle ( array $articleArray ) : void
$articleArray array
return void

saveItem() public method

Save item
public saveItem ( array $values, Item $item ) : void
$values array
$item Item
return void

setOrder() public method

Set order of items for given package
public setOrder ( Package $package, array $order ) : void
$package Package
$order array
return void

Property Details

$imageService protected_oe property

protected Newscoop\Image\ImageService $imageService
return Newscoop\Image\ImageService

$orm protected_oe property

protected Doctrine\ORM\EntityManager $orm
return Doctrine\ORM\EntityManager

$repository protected_oe property

protected Doctrine\ORM\EntityRepository $repository
return Doctrine\ORM\EntityRepository