PHP Class Newscoop\Entity\Resource

The resources can be from the database or from the file system so whenever checking resources for equality use the path property.
Inheritance: extends AbstractEntity
Mostra file Open project: sourcefabric/newscoop Class Usage Examples

Protected Properties

Property Type Description
$name string
$path string

Public Methods

Method Description
__construct ( string $path = null )
exists ( ) : boolean Check if the resource exists
getName ( ) : string Provides the name of the theme resource, must be a user frendly name used for displaying it on the UI.
getPath ( ) : string Provides the path of the resource.
getProperty ( )
isSame ( Resource $other ) : boolean Checks if the provided resource is equal with this resource.
sameAs ( Resource $other ) : boolean Checks if the provided resource is equal with this resource.
setName ( string $name ) : Newscoop\Entity\Resource Set the name of the theme resource, must be a user frendly name used for displaying it on the UI.
setPath ( string $path ) : Newscoop\Entity\Resource Set the path of the resource.

Method Details

__construct() public method

public __construct ( string $path = null )
$path string Should be id..

exists() public method

Check if the resource exists
public exists ( ) : boolean
return boolean True always for now

getName() public method

Provides the name of the theme resource, must be a user frendly name used for displaying it on the UI.
public getName ( ) : string
return string The name of the theme resource.

getPath() public method

Provides the path of the resource.
public getPath ( ) : string
return string The path of the resource.

getProperty() public method

public getProperty ( )

isSame() public method

The equality is done using the resource path.
public isSame ( Resource $other ) : boolean
$other Resource The resource to compare with.
return boolean True if the resources are considered eqaul, false otherwise.

sameAs() public method

The equality is done using the resource path.
public sameAs ( Resource $other ) : boolean
$other Resource The resource to compare with.
return boolean True if the resources are considered eqaul, false otherwise.

setName() public method

Set the name of the theme resource, must be a user frendly name used for displaying it on the UI.
public setName ( string $name ) : Newscoop\Entity\Resource
$name string The name of the theme resource, must not be null or empty.
return Newscoop\Entity\Resource This object for chaining purposes.

setPath() public method

Set the path of the resource.
public setPath ( string $path ) : Newscoop\Entity\Resource
$path string The path of the resource.
return Newscoop\Entity\Resource This object for chaining purposes.

Property Details

$name protected_oe property

protected string $name
return string

$path protected_oe property

protected string $path
return string