PHP Class Newscoop\Entity\Article

Inheritance: implements Newscoop\Search\DocumentInterface
Show file Open project: sourcefabric/newscoop Class Usage Examples

Protected Properties

Property Type Description
$articleAuthors object Article Authors for Newscoop\Gimme.
$articleOrder integer
$attachments Doctrine\Common\Collections\ArrayCollection
$authors Doctrine\Common\Collections\Collection
$comments Newscoop\Entity\Comments
$commentsLocked integer
$comments_count integer
$comments_enabled integer
$comments_link string
$creator Newscoop\Entity\User
$data ArticleData
$fields array Article fields used by Newscoop API.
$images Doctrine\Common\Collections\ArrayCollection
$indexed DateTime
$isIndexed string
$issue Newscoop\Entity\Issue
$issueId integer TODO: Fix this bug. It's not Issue Id - it's issueNumber!
$keywords string
$language Newscoop\Entity\Language
$lockTime DateTime
$lockUser Newscoop\Entity\User
$name string
$number integer
$objectId integer
$onFrontPage string
$onSection string
$packages Newscoop\Package\Package
$playlists Newscoop\Entity\Playlist
$public string
$publication Newscoop\Entity\Publication
$published DateTime
$reads integer Article reads number used by Newscoop API.
$recommended_comments_count integer
$renditions array Article renditions used by Newscoop API.
$section Newscoop\Entity\Section
$sectionId integer TODO: Fix this bug. It's not section Id - it's sectionNumber!
$shortName string
$snippets Doctrine\Common\Collections\ArrayCollection
$topics Doctrine\Common\Collections\ArrayCollection
$translations array Article translations used by Newscoop API.
$type string
$updated DateTime
$uploaded DateTime
$webcode Newscoop\Entity\Webcode
$workflowStatus string

Public Methods

Method Description
__construct ( integer $number, Language $language )
addAttachment ( Attachment $attachment ) : self Setter for attachments.
addSnippet ( Snippet $snippet ) : Newscoop\Entity\Article Add a Snippet to the Article.
addTopic ( Topic $topic ) : boolean Add Topic to the Article.
author ( string $title, array $fields ) Author article.
commentsEnabled ( ) : integer Get whether commenting is enabled.
commentsLocked ( ) : mixed Getter for commentsLocked.
getArticleAuthors ( ) : object Get articleAuthors.
getArticleOrder ( ) : integer Gets the value of articleOrder.
getAttachments ( ) : ArrayCollection Getter for attachments.
getCommentsEnabled ( ) : integer Get whether commenting is enabled.
getCommentsLocked ( ) : mixed Getter for commentsLocked.
getCreator ( ) : Newscoop\Entity\User Get creator.
getData ( string $field ) : mixed Get article type field data.
getDate ( ) : string Get date.
getFieldNames ( ) : mixed Get all field names for this article type.
getFields ( ) : object Get fields.
getFirstImage ( ) : Newscoop\Image\LocalImage Get article first image.
getId ( ) : integer Get article id.
getImages ( ) : ArrayCollection Getter for images.
getIndexed ( ) : DateTime Get indexed.
getIsIndexed ( ) : string Gets the value of isIndexed.
getIssue ( ) : Issue Getter for issue.
getIssueId ( ) : integer Gets the value of issueId.
getKeywords ( ) : string Get keywords.
getLanguage ( ) : Newscoop\Entity\Language Get language.
getLanguageCode ( ) : integer Get language code.
getLanguageId ( ) : integer Get language id.
getLanguageObject ( ) : Newscoop\Entity\Language Get language object.
getLockTime ( ) : DateTime Gets the value of lockTime.
getLockTimeDiffrence ( ) : array Gets the time difference between current and article lock time.
getLockUser ( ) : Newscoop\Entity\User Gets the value of lockUser.
getName ( ) : string Get article name.
getNumber ( ) : integer Get number.
getObject ( )
getOnFrontPage ( ) : string Gets the value of onFrontPage.
getOnSection ( ) : string Gets the value of onSection.
getPackages ( ) : object Get packages.
getPublic ( ) : string Gets the value of public.
getPublication ( ) : Newscoop\Entity\Publication Get publication.
getPublicationId ( ) : integer Get publication id.
getPublishDate ( ) : string Get publishDate.
getPublished ( ) : string Get published.
getReads ( ) : integer Set reads.
getRenditions ( ) : object Get renditions.
getSection ( ) : Section Get section.
getSectionId ( ) : integer Gets the value of sectionId.
getShortName ( ) : string Gets the value of shortName.
getSnippets ( ) Get Article Snippets.
getTitle ( ) : string Get title.
getTopicNames ( ) : array Get topic names.
getTopics ( ) : object Get topics.
getTranslations ( ) : object Get translations.
getType ( ) : string Get type.
getUpdated ( ) : mixed Getter for updated.
getUploaded ( ) : DateTime Gets the value of uploaded.
getView ( ) : object Get view.
getWebcode ( ) : string Get webcode.
getWebcodeEntity ( ) : string Get webcode object.
getWorkflowStatus ( $readable = false ) : string Get workflowStatus.
hasWebcode ( ) : boolean Test if article has webcode.
isLocked ( ) : boolean Checks if article is locked or not.
isPublished ( ) : boolean Test if article is published.
publish ( ) * Publish article
removeSnippet ( Snippet $snippet ) : Newscoop\Entity\Article Remove a Snippet from the Article.
removeTopic ( Topic $topic ) : boolean Remove a Topic from the Article.
setArticleAuthors ( $articleAuthors ) Set articleAuthors $articleAuthors.
setArticleOrder ( integer $articleOrder ) : self Sets the value of articleOrder.
setAttachments ( ArrayCollection | null $attachments ) : self Setter for attachments.
setCommentsEnabled ( integer $comments_enabled ) Set commenting en/disabled.
setCommentsLink ( string $link ) Set comments_link.
setCommentsLocked ( mixed $commentsLocked ) : self Setter for commentsLocked.
setCreator ( User $p_user ) : Article Set creator.
setData ( array $data ) Set data.
setDate ( DateTime $date ) Set date.
setFieldData ( string $field, string $value ) : mixed Set article type field data.
setFields ( $fields ) Set Fields $fields.
setId ( integer $p_id ) : Article Set article id.
setImages ( ArrayCollection $images ) : self Setter for images.
setIndexed ( DateTime $indexed = null ) : self Set indexed.
setIsIndexed ( boolean $isIndexed ) : self Sets the value of isIndexed.
setIssue ( Issue $issue ) : self Setter for issue.
setIssueId ( integer $issueId ) : self Sets the value of issueId.
setKeywords ( $keywords ) Set Keywords.
setLanguage ( Language $p_language ) : Newscoop\Entity\Article Set language.
setLockTime ( DateTime $lockTime = null ) : self Sets the value of lockTime.
setLockUser ( User $lockUser = null ) : self Sets the value of lockUser.
setName ( string $name ) : self Sets the value of name.
setNumber ( $number ) : integer Set number.
setOnFrontPage ( string $onFrontPage = false ) : self Sets the value of onFrontPage.
setOnSection ( string $onSection = false ) : self Sets the value of onSection.
setPackages ( $packages ) Set Packages $packages.
setPublic ( boolean $public ) : self Sets the value of public.
setPublication ( Publication $p_publication ) : Article Set publication.
setPublished ( Datetime | null $published ) : self Set published.
setReads ( integer $reads ) Get reads.
setRenditions ( $renditions ) Set renditions $renditions.
setSection ( Section $section ) : self Setter for section.
setSectionId ( integer $sectionId ) : self Sets the value of sectionId.
setShortName ( string $shortName ) : self Sets the value of shortName.
setTitle ( string $title ) Set title.
setTopics ( $topics ) Set Topics $topics.
setTranslations ( $translations ) Set translations $translations.
setType ( string $type ) : self Sets the value of type.
setUpdated ( DateTime $updated ) : self Setter for updated.
setUploaded ( DateTime $uploaded ) : self Sets the value of uploaded.
setWebcode ( Newscoop\Entity\Webcode $webcode ) Set webcode.
setWorkflowStatus ( $workflowStatus ) Set workflowStatus.

Private Methods

Method Description
addFields ( ArticleView $view ) : array Add field properties to view.
initArticleData ( ) : ArticleData Init ArticleData.
setFieldValue ( string $field, string $value ) Set article type field value.

Method Details

__construct() public method

public __construct ( integer $number, Language $language )
$number integer
$language Language

addAttachment() public method

Setter for attachments.
public addAttachment ( Attachment $attachment ) : self
$attachment Attachment
return self

addSnippet() public method

Add a Snippet to the Article.
public addSnippet ( Snippet $snippet ) : Newscoop\Entity\Article
$snippet Snippet the Snippet to attach
return Newscoop\Entity\Article

addTopic() public method

Add Topic to the Article.
public addTopic ( Topic $topic ) : boolean
$topic Newscoop\NewscoopBundle\Entity\Topic the Topic to attach
return boolean

author() public method

Author article.
public author ( string $title, array $fields )
$title string
$fields array

commentsEnabled() public method

Get whether commenting is enabled.
public commentsEnabled ( ) : integer
return integer

commentsLocked() public method

Getter for commentsLocked.
public commentsLocked ( ) : mixed
return mixed

getArticleAuthors() public method

Get articleAuthors.
public getArticleAuthors ( ) : object
return object

getArticleOrder() public method

Gets the value of articleOrder.
public getArticleOrder ( ) : integer
return integer

getAttachments() public method

Getter for attachments.
public getAttachments ( ) : ArrayCollection
return Doctrine\Common\Collections\ArrayCollection

getCommentsEnabled() public method

Get whether commenting is enabled.
public getCommentsEnabled ( ) : integer
return integer

getCommentsLocked() public method

Getter for commentsLocked.
public getCommentsLocked ( ) : mixed
return mixed

getCreator() public method

Get creator.
public getCreator ( ) : Newscoop\Entity\User
return Newscoop\Entity\User

getData() public method

Get article type field data.
public getData ( string $field ) : mixed
$field string
return mixed

getDate() public method

Get date.
public getDate ( ) : string
return string

getFieldNames() public method

Get all field names for this article type.
public getFieldNames ( ) : mixed
return mixed Returns array with field names or null

getFields() public method

Get fields.
public getFields ( ) : object
return object

getFirstImage() public method

Get article first image.
public getFirstImage ( ) : Newscoop\Image\LocalImage
return Newscoop\Image\LocalImage

getId() public method

Get article id.
public getId ( ) : integer
return integer

getImages() public method

Getter for images.
public getImages ( ) : ArrayCollection
return Doctrine\Common\Collections\ArrayCollection

getIndexed() public method

Get indexed.
public getIndexed ( ) : DateTime
return DateTime

getIsIndexed() public method

Gets the value of isIndexed.
public getIsIndexed ( ) : string
return string

getIssue() public method

Getter for issue.
public getIssue ( ) : Issue
return Issue

getIssueId() public method

Gets the value of issueId.
public getIssueId ( ) : integer
return integer

getKeywords() public method

Get keywords.
public getKeywords ( ) : string
return string

getLanguage() public method

Get language.
public getLanguage ( ) : Newscoop\Entity\Language
return Newscoop\Entity\Language

getLanguageCode() public method

Get language code.
public getLanguageCode ( ) : integer
return integer

getLanguageId() public method

Get language id.
public getLanguageId ( ) : integer
return integer

getLanguageObject() public method

Get language object.
public getLanguageObject ( ) : Newscoop\Entity\Language
return Newscoop\Entity\Language

getLockTime() public method

Gets the value of lockTime.
public getLockTime ( ) : DateTime
return DateTime

getLockTimeDiffrence() public method

Gets the time difference between current and article lock time.
public getLockTimeDiffrence ( ) : array
return array

getLockUser() public method

Gets the value of lockUser.
public getLockUser ( ) : Newscoop\Entity\User
return Newscoop\Entity\User

getName() public method

Get article name.
public getName ( ) : string
return string

getNumber() public method

Get number.
public getNumber ( ) : integer
return integer

getObject() public method

public getObject ( )

getOnFrontPage() public method

Gets the value of onFrontPage.
public getOnFrontPage ( ) : string
return string

getOnSection() public method

Gets the value of onSection.
public getOnSection ( ) : string
return string

getPackages() public method

Get packages.
public getPackages ( ) : object
return object

getPublic() public method

Gets the value of public.
public getPublic ( ) : string
return string

getPublication() public method

Get publication.
public getPublication ( ) : Newscoop\Entity\Publication
return Newscoop\Entity\Publication

getPublicationId() public method

Get publication id.
public getPublicationId ( ) : integer
return integer

getPublishDate() public method

Get publishDate.
public getPublishDate ( ) : string
return string

getPublished() public method

Get published.
public getPublished ( ) : string
return string

getReads() public method

Set reads.
public getReads ( ) : integer
return integer

getRenditions() public method

Get renditions.
public getRenditions ( ) : object
return object

getSection() public method

Get section.
public getSection ( ) : Section
return Section

getSectionId() public method

Gets the value of sectionId.
public getSectionId ( ) : integer
return integer

getShortName() public method

Gets the value of shortName.
public getShortName ( ) : string
return string

getSnippets() public method

Get Article Snippets.
public getSnippets ( )

getTitle() public method

Get title.
public getTitle ( ) : string
return string

getTopicNames() public method

Get topic names.
public getTopicNames ( ) : array
return array

getTopics() public method

Get topics.
public getTopics ( ) : object
return object

getTranslations() public method

Get translations.
public getTranslations ( ) : object
return object

getType() public method

Get type.
public getType ( ) : string
return string

getUpdated() public method

Getter for updated.
public getUpdated ( ) : mixed
return mixed

getUploaded() public method

Gets the value of uploaded.
public getUploaded ( ) : DateTime
return DateTime

getView() public method

Get view.
public getView ( ) : object
return object

getWebcode() public method

Get webcode.
public getWebcode ( ) : string
return string

getWebcodeEntity() public method

Get webcode object.
public getWebcodeEntity ( ) : string
return string

getWorkflowStatus() public method

Get workflowStatus.
public getWorkflowStatus ( $readable = false ) : string
return string

hasWebcode() public method

Test if article has webcode.
public hasWebcode ( ) : boolean
return boolean

isLocked() public method

Checks if article is locked or not.
public isLocked ( ) : boolean
return boolean

isPublished() public method

Test if article is published.
public isPublished ( ) : boolean
return boolean

publish() public method

* Publish article
public publish ( )

removeSnippet() public method

Remove a Snippet from the Article.
public removeSnippet ( Snippet $snippet ) : Newscoop\Entity\Article
$snippet Snippet the Snippet to remove
return Newscoop\Entity\Article

removeTopic() public method

Remove a Topic from the Article.
public removeTopic ( Topic $topic ) : boolean
$topic Newscoop\NewscoopBundle\Entity\Topic the Topic to remove
return boolean

setArticleAuthors() public method

Set articleAuthors $articleAuthors.
public setArticleAuthors ( $articleAuthors )

setArticleOrder() public method

Sets the value of articleOrder.
public setArticleOrder ( integer $articleOrder ) : self
$articleOrder integer the article order
return self

setAttachments() public method

Setter for attachments.
public setAttachments ( ArrayCollection | null $attachments ) : self
$attachments Doctrine\Common\Collections\ArrayCollection | null Value to set
return self

setCommentsEnabled() public method

Set commenting en/disabled.
public setCommentsEnabled ( integer $comments_enabled )
$comments_enabled integer

setCommentsLocked() public method

Setter for commentsLocked.
public setCommentsLocked ( mixed $commentsLocked ) : self
$commentsLocked mixed Value to set
return self

setCreator() public method

Set creator.
public setCreator ( User $p_user ) : Article
$p_user User
return Article

setData() public method

Set data.
public setData ( array $data )
$data array

setDate() public method

Set date.
public setDate ( DateTime $date )
$date DateTime

setFieldData() public method

Set article type field data.
public setFieldData ( string $field, string $value ) : mixed
$field string
$value string
return mixed

setFields() public method

Set Fields $fields.
public setFields ( $fields )

setId() public method

Set article id.
public setId ( integer $p_id ) : Article
$p_id integer
return Article

setImages() public method

Setter for images.
public setImages ( ArrayCollection $images ) : self
$images Doctrine\Common\Collections\ArrayCollection Value to set
return self

setIndexed() public method

Set indexed.
public setIndexed ( DateTime $indexed = null ) : self
$indexed DateTime
return self

setIsIndexed() public method

Sets the value of isIndexed.
public setIsIndexed ( boolean $isIndexed ) : self
$isIndexed boolean the is indexed
return self

setIssue() public method

Setter for issue.
public setIssue ( Issue $issue ) : self
$issue Issue Value to set
return self

setIssueId() public method

Sets the value of issueId.
public setIssueId ( integer $issueId ) : self
$issueId integer the issue id
return self

setKeywords() public method

$keywords
public setKeywords ( $keywords )

setLanguage() public method

Set language.
public setLanguage ( Language $p_language ) : Newscoop\Entity\Article
$p_language Language
return Newscoop\Entity\Article

setLockTime() public method

Sets the value of lockTime.
public setLockTime ( DateTime $lockTime = null ) : self
$lockTime DateTime the lock time
return self

setLockUser() public method

Sets the value of lockUser.
public setLockUser ( User $lockUser = null ) : self
$lockUser User the lock user
return self

setName() public method

Sets the value of name.
public setName ( string $name ) : self
$name string the name
return self

setNumber() public method

Set number.
public setNumber ( $number ) : integer
return integer

setOnFrontPage() public method

Sets the value of onFrontPage.
public setOnFrontPage ( string $onFrontPage = false ) : self
$onFrontPage string the on front page
return self

setOnSection() public method

Sets the value of onSection.
public setOnSection ( string $onSection = false ) : self
$onSection string the on section
return self

setPackages() public method

Set Packages $packages.
public setPackages ( $packages )

setPublic() public method

Sets the value of public.
public setPublic ( boolean $public ) : self
$public boolean the public
return self

setPublication() public method

Set publication.
public setPublication ( Publication $p_publication ) : Article
$p_publication Publication
return Article

setPublished() public method

Set published.
public setPublished ( Datetime | null $published ) : self
$published Datetime | null
return self

setReads() public method

Get reads.
public setReads ( integer $reads )
$reads integer

setRenditions() public method

Set renditions $renditions.
public setRenditions ( $renditions )

setSection() public method

Setter for section.
public setSection ( Section $section ) : self
$section Section
return self

setSectionId() public method

Sets the value of sectionId.
public setSectionId ( integer $sectionId ) : self
$sectionId integer the section id
return self

setShortName() public method

Sets the value of shortName.
public setShortName ( string $shortName ) : self
$shortName string the short name
return self

setTitle() public method

Set title.
public setTitle ( string $title )
$title string

setTopics() public method

Set Topics $topics.
public setTopics ( $topics )

setTranslations() public method

Set translations $translations.
public setTranslations ( $translations )

setType() public method

Sets the value of type.
public setType ( string $type ) : self
$type string the type
return self

setUpdated() public method

Setter for updated.
public setUpdated ( DateTime $updated ) : self
$updated DateTime Value to set
return self

setUploaded() public method

Sets the value of uploaded.
public setUploaded ( DateTime $uploaded ) : self
$uploaded DateTime the uploaded
return self

setWebcode() public method

Set webcode.
public setWebcode ( Newscoop\Entity\Webcode $webcode )
$webcode Newscoop\Entity\Webcode

setWorkflowStatus() public method

Set workflowStatus.
public setWorkflowStatus ( $workflowStatus )

Property Details

$articleAuthors protected property

Article Authors for Newscoop\Gimme.
protected object $articleAuthors
return object

$articleOrder protected property

protected int $articleOrder
return integer

$attachments protected property

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

$authors protected property

protected Doctrine\Common\Collections\Collection $authors
return Doctrine\Common\Collections\Collection

$comments protected property

protected Newscoop\Entity\Comments $comments
return Newscoop\Entity\Comments

$commentsLocked protected property

protected int $commentsLocked
return integer

$comments_count protected property

protected int $comments_count
return integer

$comments_enabled protected property

protected int $comments_enabled
return integer

$creator protected property

protected Newscoop\Entity\User $creator
return Newscoop\Entity\User

$data protected property

protected ArticleData $data
return ArticleData

$fields protected property

Article fields used by Newscoop API.
protected array $fields
return array

$images protected property

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

$indexed protected property

protected DateTime $indexed
return DateTime

$isIndexed protected property

protected string $isIndexed
return string

$issue protected property

protected Newscoop\Entity\Issue $issue
return Newscoop\Entity\Issue

$issueId protected property

TODO: Fix this bug. It's not Issue Id - it's issueNumber!
protected int $issueId
return integer

$keywords protected property

protected string $keywords
return string

$language protected property

protected Newscoop\Entity\Language $language
return Newscoop\Entity\Language

$lockTime protected property

protected DateTime $lockTime
return DateTime

$lockUser protected property

protected Newscoop\Entity\User $lockUser
return Newscoop\Entity\User

$name protected property

protected string $name
return string

$number protected property

protected int $number
return integer

$objectId protected property

protected int $objectId
return integer

$onFrontPage protected property

protected string $onFrontPage
return string

$onSection protected property

protected string $onSection
return string

$packages protected property

protected Newscoop\Package\Package $packages
return Newscoop\Package\Package

$playlists protected property

protected Newscoop\Entity\Playlist $playlists
return Newscoop\Entity\Playlist

$public protected property

protected string $public
return string

$publication protected property

protected Newscoop\Entity\Publication $publication
return Newscoop\Entity\Publication

$published protected property

protected DateTime $published
return DateTime

$reads protected property

Article reads number used by Newscoop API.
protected int $reads
return integer

$renditions protected property

Article renditions used by Newscoop API.
protected array $renditions
return array

$section protected property

protected Newscoop\Entity\Section $section
return Newscoop\Entity\Section

$sectionId protected property

TODO: Fix this bug. It's not section Id - it's sectionNumber!
protected int $sectionId
return integer

$shortName protected property

protected string $shortName
return string

$snippets protected property

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

$topics protected property

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

$translations protected property

Article translations used by Newscoop API.
protected array $translations
return array

$type protected property

protected string $type
return string

$updated protected property

protected DateTime $updated
return DateTime

$uploaded protected property

protected DateTime $uploaded
return DateTime

$webcode protected property

protected Newscoop\Entity\Webcode $webcode
return Newscoop\Entity\Webcode

$workflowStatus protected property

protected string $workflowStatus
return string