PHP Класс Common\Core\Model

Наследование: extends BaseModel
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$modules array Cached modules

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

Метод Описание
addNumber ( string $string ) : string Add a number to the string
generatePassword ( integer $length = 6, boolean $uppercaseAllowed = true, boolean $lowercaseAllowed = true ) : string Generate a totally random but readable/speakable password
generateThumbnails ( string $path, string $sourceFile ) Generate thumbnails based on the folders in the path Use - 128x128 as foldername to generate an image where the width will be 128px and the height will be 128px - 128x as foldername to generate an image where the width will be 128px, the height will be calculated based on the aspect ratio.
getModules ( ) : array Get the modules
getThumbnailFolders ( string $path, boolean $includeSource = false ) : array Get the thumbnail folders
getUTCDate ( string $format = null, integer $timestamp = null ) : string Get the UTC date in a specific format. Use this method when inserting dates in the database!
getUTCTimestamp ( SpoonFormDate $date, SpoonFormTime $time = null ) : integer Get the UTC timestamp for a date/time object combination.
startProcessingHooks ( ) Start processing the hooks
subscribeToEvent ( string $eventModule, string $eventName, string $module, mixed $callback ) Subscribe to an event, when the subscription already exists, the callback will be updated.
triggerEvent ( string $module, string $eventName, mixed $data = null ) Trigger an event
unsubscribeFromEvent ( string $eventModule, string $eventName, string $module ) Unsubscribe from an event

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

addNumber() публичный статический Метод

Add a number to the string
public static addNumber ( string $string ) : string
$string string The string where the number will be appended to.
Результат string

generatePassword() публичный статический Метод

Generate a totally random but readable/speakable password
public static generatePassword ( integer $length = 6, boolean $uppercaseAllowed = true, boolean $lowercaseAllowed = true ) : string
$length integer The maximum length for the password to generate.
$uppercaseAllowed boolean Are uppercase letters allowed?
$lowercaseAllowed boolean Are lowercase letters allowed?
Результат string

generateThumbnails() публичный статический Метод

- x128 as foldername to generate an image where the height will be 128px, the width will be calculated based on the aspect ratio.
public static generateThumbnails ( string $path, string $sourceFile )
$path string The path wherein the thumbnail-folders will be stored.
$sourceFile string The location of the source file.

getModules() публичный статический Метод

Get the modules
public static getModules ( ) : array
Результат array

getThumbnailFolders() публичный статический Метод

Get the thumbnail folders
public static getThumbnailFolders ( string $path, boolean $includeSource = false ) : array
$path string The path
$includeSource boolean Should the source-folder be included in the return-array.
Результат array

getUTCDate() публичный статический Метод

Get the UTC date in a specific format. Use this method when inserting dates in the database!
public static getUTCDate ( string $format = null, integer $timestamp = null ) : string
$format string The format to return the timestamp in. Default is MySQL datetime format.
$timestamp integer The timestamp to use, if not provided the current time will be used.
Результат string

getUTCTimestamp() публичный статический Метод

Get the UTC timestamp for a date/time object combination.
public static getUTCTimestamp ( SpoonFormDate $date, SpoonFormTime $time = null ) : integer
$date SpoonFormDate An instance of \SpoonFormDate.
$time SpoonFormTime An instance of \SpoonFormTime.
Результат integer

startProcessingHooks() публичный статический Метод

Start processing the hooks
Устаревший: use the symfony event dispatcher instead
public static startProcessingHooks ( )

subscribeToEvent() публичный статический Метод

Subscribe to an event, when the subscription already exists, the callback will be updated.
Устаревший: use the symfony event dispatcher instead
public static subscribeToEvent ( string $eventModule, string $eventName, string $module, mixed $callback )
$eventModule string The module that triggers the event.
$eventName string The name of the event.
$module string The module that subscribes to the event.
$callback mixed The callback that should be executed when the event is triggered.

triggerEvent() публичный статический Метод

Trigger an event
Устаревший: use the symfony event dispatcher instead
public static triggerEvent ( string $module, string $eventName, mixed $data = null )
$module string The module that triggers the event.
$eventName string The name of the event.
$data mixed The data that should be send to subscribers.

unsubscribeFromEvent() публичный статический Метод

Unsubscribe from an event
Устаревший: use the symfony event dispatcher instead
public static unsubscribeFromEvent ( string $eventModule, string $eventName, string $module )
$eventModule string The module that triggers the event.
$eventName string The name of the event.
$module string The module that subscribes to the event.

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

$modules защищенное статическое свойство

Cached modules
protected static array $modules
Результат array