PHP Class Newscoop\Service\Implementation\ArticleTypeServiceDoctrine

Inheritance: implements Newscoop\Service\IArticleTypeService
Datei anzeigen Open project: sourcefabric/newscoop

Protected Properties

Property Type Description
$em Doctrine\ORM\EntityManager
$id Newscoop\Service\Resource\ResourceId

Public Methods

Method Description
__construct ( ResourceId $id ) Construct the service base d on the provided resource id.
create ( string $name ) : ArticleType Creates an article type
createField ( string $name, ArticleType $type, array $props = null ) : ArticleTypeField Creates a field
createMany ( array $articleTypes ) Creates more article types
findAllTypes ( )
findFieldByName ( ArticleType $type, $name )
findFields ( ArticleType $type )
findTypeByName ( $name )
getCount ( Search $search = NULL )

Protected Methods

Method Description
getManager ( ) : Doctrine\ORM\EntityManager Provides the dictrine entity manager.
getResourceId ( ) : Newscoop\Services\Resource\ResourceId Provides the resource id.

Private Methods

Method Description
_create ( $name )
_createField ( $name, ArticleType $type, $props = null )

Method Details

__construct() public method

Construct the service base d on the provided resource id.
public __construct ( ResourceId $id )
$id Newscoop\Service\Resource\ResourceId The resource id, not null not empty

create() public method

Creates an article type
public create ( string $name ) : ArticleType
$name string the name of the new article type, not null
return Newscoop\Entity\ArticleType

createField() public method

Creates a field
public createField ( string $name, ArticleType $type, array $props = null ) : ArticleTypeField
$name string the name of the article type field, not null
$type Newscoop\Entity\ArticleType
$props array properies of the field @see Newscoop\Entity\ArticleType
return Newscoop\Entity\ArticleTypeField

createMany() public method

Creates more article types
See also: self::create()
public createMany ( array $articleTypes )
$articleTypes array the array of types, optionally with fields [ typeName => [ fields : [ name : fieldName, parentType : typeName, ignore : bool ], [...] ], [...] ]

findAllTypes() public method

public findAllTypes ( )

findFieldByName() public method

public findFieldByName ( ArticleType $type, $name )
$type Newscoop\Entity\ArticleType

findFields() public method

public findFields ( ArticleType $type )
$type Newscoop\Entity\ArticleType

findTypeByName() public method

public findTypeByName ( $name )

getCount() public method

public getCount ( Search $search = NULL )
$search Search

getManager() protected method

Provides the dictrine entity manager.
protected getManager ( ) : Doctrine\ORM\EntityManager
return Doctrine\ORM\EntityManager The doctrine entity manager.

getResourceId() protected method

Provides the resource id.
protected getResourceId ( ) : Newscoop\Services\Resource\ResourceId
return Newscoop\Services\Resource\ResourceId The resource id.

Property Details

$em protected_oe property

protected Doctrine\ORM\EntityManager $em
return Doctrine\ORM\EntityManager

$id protected_oe property

protected ResourceId,Newscoop\Service\Resource $id
return Newscoop\Service\Resource\ResourceId