PHP Class Newscoop\Entity\Snippet

Datei anzeigen Open project: sourcefabric/newscoop Class Usage Examples

Protected Properties

Property Type Description
$articles Newscoop\Entity\Article
$created string
$enabled boolean
$fields Doctrine\Common\Collections\ArrayCollection
$id integer
$modified string
$name string
$template Newscoop\Entity\Snippet\SnippetTemplate

Public Methods

Method Description
__construct ( SnippetTemplate $template ) Constructs the Snippet
addArticle ( Article $article ) : Newscoop\Entity\Snippet Add an Article to the Snippet
getArticles ( ) : ArrayCollection Return the attached Articles
getCreated ( ) : DateTime Getter for created
getEnabled ( ) : mixed Getter for enabled
getFields ( ) : ArrayCollection Getter for fields
getFieldsWithoutBackend ( ) : ArrayCollection Getter for fields without the Backend scope
getId ( ) : integer Getter for id
getModified ( ) : mixed Getter for modified
getName ( ) : string Getter for Name
getTemplate ( ) : SnippetTemplate Getter for Template
getTemplateId ( ) : integer Returns the Template id
getTemplateName ( ) : string Returns the Template Name
hasName ( ) : boolean Check if Snippet has a name
removeArticle ( Article $article ) : Newscoop\Entity\Snippet Remove an Article from the Snippet
render ( ) : string Renders the Snippet with the Data into the Template
setCreated ( DateTime $created = null ) : Newscoop\Entity\Snippet Setter for created
setData ( string $fieldName, string $fieldData = null ) : Newscoop\Entity\Snippet Set Snippet Data to the appropriate fields
setEnabled ( mixed $enabled ) : self Setter for enabled
setId ( integer $id ) : Newscoop\Entity\Snippet Setter for id
setModified ( mixed $modified = null ) : self Setter for modified
setName ( string $name ) : Newscoop\Entity\Snippet Setter for Name
setTemplate ( SnippetTemplate $template ) : Newscoop\Entity\Snippet Setter for Template

Private Methods

Method Description
addField ( SnippetField $field ) : Newscoop\Entity\Snippet Add Snippet fields

Method Details

__construct() public method

Constructs the Snippet
public __construct ( SnippetTemplate $template )
$template Newscoop\Entity\Snippet\SnippetTemplate SnippetTemplate to set for this Snippet

addArticle() public method

Add an Article to the Snippet
public addArticle ( Article $article ) : Newscoop\Entity\Snippet
$article Article the Article to attach
return Newscoop\Entity\Snippet

getArticles() public method

Return the attached Articles
public getArticles ( ) : ArrayCollection
return Doctrine\Common\Collections\ArrayCollection

getCreated() public method

Getter for created
public getCreated ( ) : DateTime
return DateTime

getEnabled() public method

Getter for enabled
public getEnabled ( ) : mixed
return mixed

getFields() public method

Getter for fields
public getFields ( ) : ArrayCollection
return Doctrine\Common\Collections\ArrayCollection

getFieldsWithoutBackend() public method

Getter for fields without the Backend scope
public getFieldsWithoutBackend ( ) : ArrayCollection
return Doctrine\Common\Collections\ArrayCollection

getId() public method

Getter for id
public getId ( ) : integer
return integer

getModified() public method

Getter for modified
public getModified ( ) : mixed
return mixed

getName() public method

Getter for Name
public getName ( ) : string
return string

getTemplate() public method

Getter for Template
public getTemplate ( ) : SnippetTemplate
return Newscoop\Entity\Snippet\SnippetTemplate

getTemplateId() public method

Returns the Template id
public getTemplateId ( ) : integer
return integer template id

getTemplateName() public method

Returns the Template Name
public getTemplateName ( ) : string
return string template name

hasName() public method

Check if Snippet has a name
public hasName ( ) : boolean
return boolean

removeArticle() public method

Remove an Article from the Snippet
public removeArticle ( Article $article ) : Newscoop\Entity\Snippet
$article Article the Article to remove
return Newscoop\Entity\Snippet

render() public method

Renders the Snippet with the Data into the Template
public render ( ) : string
return string rendered Snippet

setCreated() public method

Setter for created
public setCreated ( DateTime $created = null ) : Newscoop\Entity\Snippet
$created DateTime Value to set
return Newscoop\Entity\Snippet

setData() public method

Set Snippet Data to the appropriate fields
public setData ( string $fieldName, string $fieldData = null ) : Newscoop\Entity\Snippet
$fieldName string the name of the SnippetField
$fieldData string the data of the SnippetField
return Newscoop\Entity\Snippet

setEnabled() public method

Setter for enabled
public setEnabled ( mixed $enabled ) : self
$enabled mixed Value to set
return self

setId() public method

Setter for id
public setId ( integer $id ) : Newscoop\Entity\Snippet
$id integer
return Newscoop\Entity\Snippet

setModified() public method

Setter for modified
public setModified ( mixed $modified = null ) : self
$modified mixed Value to set
return self

setName() public method

Setter for Name
public setName ( string $name ) : Newscoop\Entity\Snippet
$name string
return Newscoop\Entity\Snippet

setTemplate() public method

Setter for Template
public setTemplate ( SnippetTemplate $template ) : Newscoop\Entity\Snippet
$template Newscoop\Entity\Snippet\SnippetTemplate
return Newscoop\Entity\Snippet

Property Details

$articles protected_oe property

protected Newscoop\Entity\Article $articles
return Newscoop\Entity\Article

$created protected_oe property

protected string $created
return string

$enabled protected_oe property

protected bool $enabled
return boolean

$fields protected_oe property

protected ArrayCollection,Doctrine\Common\Collections $fields
return Doctrine\Common\Collections\ArrayCollection

$id protected_oe property

protected int $id
return integer

$modified protected_oe property

protected string $modified
return string

$name protected_oe property

protected string $name
return string

$template protected_oe property

protected SnippetTemplate,Newscoop\Entity\Snippet $template
return Newscoop\Entity\Snippet\SnippetTemplate