PHP Класс 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.
Наследование: extends AbstractEntity
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$name string
$path string

Открытые методы

Метод Описание
__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.

Описание методов

__construct() публичный метод

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

exists() публичный метод

Check if the resource exists
public exists ( ) : boolean
Результат boolean True always for now

getName() публичный метод

Provides the name of the theme resource, must be a user frendly name used for displaying it on the UI.
public getName ( ) : string
Результат string The name of the theme resource.

getPath() публичный метод

Provides the path of the resource.
public getPath ( ) : string
Результат string The path of the resource.

getProperty() публичный метод

public getProperty ( )

isSame() публичный метод

The equality is done using the resource path.
public isSame ( Resource $other ) : boolean
$other Resource The resource to compare with.
Результат boolean True if the resources are considered eqaul, false otherwise.

sameAs() публичный метод

The equality is done using the resource path.
public sameAs ( Resource $other ) : boolean
$other Resource The resource to compare with.
Результат boolean True if the resources are considered eqaul, false otherwise.

setName() публичный метод

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.
Результат Newscoop\Entity\Resource This object for chaining purposes.

setPath() публичный метод

Set the path of the resource.
public setPath ( string $path ) : Newscoop\Entity\Resource
$path string The path of the resource.
Результат Newscoop\Entity\Resource This object for chaining purposes.

Описание свойств

$name защищенное свойство

protected string $name
Результат string

$path защищенное свойство

protected string $path
Результат string