PHP Class Newscoop\Image\LocalImage

Inheritance: implements Newscoop\Image\ImageInterface
显示文件 Open project: sourcefabric/newscoop Class Usage Examples

Public Properties

Property Type Description
$id integer

Protected Properties

Property Type Description
$articleImageId Virtual property set by rest api with connection to articleImage
$basename string
$captions array
$contentType string
$created DateTime
$date string
$description text
$height integer
$isUpdatedStorage integer
$items Doctrine\Common\Collections\Collection
$location string
$photographer string
$photographerUrl string
$place string
$renditions Doctrine\Common\Collections\Collection
$source string
$status string
$thumbnailPath string
$updated DateTime
$url string
$user Newscoop\Entity\User
$width integer

Public Methods

Method Description
__construct ( string $image = '' )
getArticleImageId ( ) : mixed Gets articleImage.
getBasename ( ) : string Gets the value of basename.
getCaption ( ) : string Get caption
getCaptions ( ) : array Get captions
getContentType ( ) : string Gets the value of contentType.
getCreated ( ) : DateTime Gets the value of created.
getDate ( ) : string Get date
getDescription ( ) : string Get description
getHeight ( ) : integer Get height
getId ( ) : integer Get id
getPath ( ) : string Get path
getPhotographer ( ) : string Get photographer
getPhotographerUrl ( ) : string Get photographer url
getPlace ( ) : string Get place
getSource ( ) : string Get source
getStatus ( ) : string Gets the value of status.
getThumbnailPath ( $clear = false ) : string Get thumbnail path
getUpdated ( ) : DateTime Gets the value of updated.
getUser ( ) : User Gets the value of user.
getWidth ( ) : integer Get width
hasUpdatedStorage ( ) : boolean Test is storage was updated
hasWidth ( ) : boolean Test if image has defined width
isLocal ( ) : boolean Test if is local image
setArticleImageId ( mixed $articleImageId ) : self Sets articleImage.
setBasename ( string $basename ) : self Sets the value of basename.
setContentType ( string $contentType ) : self Sets the value of contentType.
setCreated ( DateTime $created ) : self Sets the value of created.
setDate ( string $date ) : void Set date
setDescription ( string $description ) : void Set description
setHeight ( integer $height ) : self Sets the value of height.
setPhotographer ( string $photographer ) : void Set photographer
setPhotographerUrl ( string $url ) : void Set photographer url
setPlace ( string $place ) : void Set place
setSource ( string $source ) : self Sets the value of source.
setStatus ( string $status = null ) : self Sets the value of status.
setThumbnailPath ( string $thumbnailPath ) : self Sets the value of thumbnailPath.
setUpdated ( DateTime $updated ) : self Sets the value of updated.
setUrl ( string $url ) : self Sets the value of url.
setUser ( User $user = null ) : self Sets the value of user.
setWidth ( integer $width ) : self Sets the value of width.
updateStorage ( string $path, string $thumbnailPath ) : void Update storage
upload ( string $path, string $thumbnailPath ) : void Upload image

Private Methods

Method Description
getInfo ( ) : array Get image info
saveEntity ( ) : void Store updated info if persisted
setBroken ( ) : void Set image as broken

Method Details

__construct() public method

public __construct ( string $image = '' )
$image string

getArticleImageId() public method

Gets articleImage.
public getArticleImageId ( ) : mixed
return mixed

getBasename() public method

Gets the value of basename.
public getBasename ( ) : string
return string

getCaption() public method

Proxy to getDescription
public getCaption ( ) : string
return string

getCaptions() public method

Get captions
public getCaptions ( ) : array
return array

getContentType() public method

Gets the value of contentType.
public getContentType ( ) : string
return string

getCreated() public method

Gets the value of created.
public getCreated ( ) : DateTime
return DateTime

getDate() public method

Get date
public getDate ( ) : string
return string

getDescription() public method

Get description
public getDescription ( ) : string
return string

getHeight() public method

Get height
public getHeight ( ) : integer
return integer

getId() public method

Get id
public getId ( ) : integer
return integer

getPath() public method

Get path
public getPath ( ) : string
return string

getPhotographer() public method

Get photographer
public getPhotographer ( ) : string
return string

getPhotographerUrl() public method

Get photographer url
public getPhotographerUrl ( ) : string
return string

getPlace() public method

Get place
public getPlace ( ) : string
return string

getSource() public method

Get source
public getSource ( ) : string
return string

getStatus() public method

Gets the value of status.
public getStatus ( ) : string
return string

getThumbnailPath() public method

Get thumbnail path
public getThumbnailPath ( $clear = false ) : string
return string

getUpdated() public method

Gets the value of updated.
public getUpdated ( ) : DateTime
return DateTime

getUser() public method

Gets the value of user.
public getUser ( ) : User
return Newscoop\Entity\User

getWidth() public method

Get width
public getWidth ( ) : integer
return integer

hasUpdatedStorage() public method

Test is storage was updated
public hasUpdatedStorage ( ) : boolean
return boolean

hasWidth() public method

Test if image has defined width
public hasWidth ( ) : boolean
return boolean

isLocal() public method

Test if is local image
public isLocal ( ) : boolean
return boolean

setArticleImageId() public method

Sets articleImage.
public setArticleImageId ( mixed $articleImageId ) : self
$articleImageId mixed the article image id
return self

setBasename() public method

Sets the value of basename.
public setBasename ( string $basename ) : self
$basename string the basename
return self

setContentType() public method

Sets the value of contentType.
public setContentType ( string $contentType ) : self
$contentType string the content type
return self

setCreated() public method

Sets the value of created.
public setCreated ( DateTime $created ) : self
$created DateTime the created
return self

setDate() public method

Set date
public setDate ( string $date ) : void
$date string
return void

setDescription() public method

Set description
public setDescription ( string $description ) : void
$description string
return void

setHeight() public method

Sets the value of height.
public setHeight ( integer $height ) : self
$height integer the height
return self

setPhotographer() public method

Set photographer
public setPhotographer ( string $photographer ) : void
$photographer string
return void

setPhotographerUrl() public method

Set photographer url
public setPhotographerUrl ( string $url ) : void
$url string
return void

setPlace() public method

Set place
public setPlace ( string $place ) : void
$place string
return void

setSource() public method

Sets the value of source.
public setSource ( string $source ) : self
$source string the source
return self

setStatus() public method

Sets the value of status.
public setStatus ( string $status = null ) : self
$status string the status
return self

setThumbnailPath() public method

Sets the value of thumbnailPath.
public setThumbnailPath ( string $thumbnailPath ) : self
$thumbnailPath string the thumbnail path
return self

setUpdated() public method

Sets the value of updated.
public setUpdated ( DateTime $updated ) : self
$updated DateTime the updated
return self

setUrl() public method

Sets the value of url.
public setUrl ( string $url ) : self
$url string the url
return self

setUser() public method

Sets the value of user.
public setUser ( User $user = null ) : self
$user Newscoop\Entity\User the user
return self

setWidth() public method

Sets the value of width.
public setWidth ( integer $width ) : self
$width integer the width
return self

updateStorage() public method

Update storage
public updateStorage ( string $path, string $thumbnailPath ) : void
$path string
$thumbnailPath string
return void

upload() public method

Upload image
public upload ( string $path, string $thumbnailPath ) : void
$path string
$thumbnailPath string
return void

Property Details

$articleImageId protected_oe property

Virtual property set by rest api with connection to articleImage
protected $articleImageId

$basename protected_oe property

protected string $basename
return string

$captions protected_oe property

protected array $captions
return array

$contentType protected_oe property

protected string $contentType
return string

$created protected_oe property

protected DateTime $created
return DateTime

$date protected_oe property

protected string $date
return string

$description protected_oe property

protected text $description
return text

$height protected_oe property

protected int $height
return integer

$id public_oe property

public int $id
return integer

$isUpdatedStorage protected_oe property

protected int $isUpdatedStorage
return integer

$items protected_oe property

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

$location protected_oe property

protected string $location
return string

$photographer protected_oe property

protected string $photographer
return string

$photographerUrl protected_oe property

protected string $photographerUrl
return string

$place protected_oe property

protected string $place
return string

$renditions protected_oe property

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

$source protected_oe property

protected string $source
return string

$status protected_oe property

protected string $status
return string

$thumbnailPath protected_oe property

protected string $thumbnailPath
return string

$updated protected_oe property

protected DateTime $updated
return DateTime

$url protected_oe property

protected string $url
return string

$user protected_oe property

protected Newscoop\Entity\User $user
return Newscoop\Entity\User

$width protected_oe property

protected int $width
return integer