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
Afficher le fichier Open project: sourcefabric/newscoop Class Usage Examples

Protected Properties

Свойство Type Description
$name string
$path string

Méthodes publiques

Méthode 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 méthode

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

exists() public méthode

Check if the resource exists
public exists ( ) : boolean
Résultat boolean True always for now

getName() public méthode

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

getPath() public méthode

Provides the path of the resource.
public getPath ( ) : string
Résultat string The path of the resource.

getProperty() public méthode

public getProperty ( )

isSame() public méthode

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

sameAs() public méthode

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

setName() public méthode

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.
Résultat Newscoop\Entity\Resource This object for chaining purposes.

setPath() public méthode

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

Property Details

$name protected_oe property

protected string $name
Résultat string

$path protected_oe property

protected string $path
Résultat string