PHP Class Gdn, vanilla

Garden is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Garden is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Garden. If not, see . Contact Mark O'Sullivan at mark [at] lussumo [dot] com
Show file Open project: vanilla/vanilla Class Usage Examples

Protected Properties

Property Type Description
$_Config object
$_Factory The factory used to create core objects in the application.
$_FactoryOverwrite Whether or not Gdn::FactoryInstall should overwrite existing objects.
$_Locale object
$_PluginManager object
$_Request object
$_Session object

Public Methods

Method Description
addonManager ( ) : AddonManager Get the addon manager.
applicationManager ( ) : Gdn_ApplicationManager Get the application manager
authenticator ( ) : Gdn_Auth
cache ( ) : Gdn_Cache Get the cache object
config ( string $Name = false, mixed $Default = false ) : Gdn_Configuration | mixed Get a configuration setting for the application.
controller ( Gdn_Controller $Value = null ) : Gdn_Controller The current controller being targetted.
database ( ) : Gdn_Database Get a reference to the default database object.
dispatcher ( ) : Gdn_Dispatcher Gets the global dispatcher object.
factory ( string $Alias = false ) Get an object from the factory.
factoryExists ( string $Alias ) : boolean Checks whether or not a factory alias exists.
factoryInstall ( string $Alias, string $ClassName, string $Path = '', string $FactoryType = self::FactorySingleton, $Data = null ) Install a class to the factory.
factoryInstallDependency ( string $Alias, string $PropertyName, string $SourceAlias ) Installs a dependency to the factory.
factoryInstallDependencyFromConfig ( mixed $Config, string $Alias = null ) Installs a dependency to the factory with the settings from a configuration.
factoryInstallFromConfig ( mixed $Config, string $Alias = null ) Installs a class to the factory with the settings from a configuration.
factoryOverwrite ( null $Value = null ) : integer
factoryUninstall ( string $Alias ) Uninstall an class from the factory.
factoryUninstallDependency ( $Alias, $PropertyName = null ) Uninstall a dependency from the factory.
get ( $Key, $Default = null )
installationID ( string $SetInstallationID = null ) : string Gets/Sets the Garden InstallationID
installationSecret ( string $SetInstallationSecret = null ) : string Gets/Sets the Garden Installation Secret
locale ( ) : Gdn_Locale
permissionModel ( ) : PermissionModel Get the permission model for the application.
pluginManager ( ) : Gdn_PluginManager Get the plugin manager for the application.
regarding ( ) : Gdn_Regarding
request ( Gdn_Request $NewRequest = null ) : Gdn_Request Get or set the current request object.
router ( ) : Gdn_Router Get the router object
session ( ) : Gdn_Session Get the session object.
set ( $Key, $Value = null )
setFactory ( Gdn_Factory $Factory, boolean $Override = true ) Set the object used as the factory for the api.
slice ( string $Slice ) : Gdn_Slice Get a reference to the Gdn_Slice
sql ( ) : Gdn_SQLDriver Get a reference to the default SQL driver object.
statistics ( ) : Gdn_Statistics Get a reference to the Statistics object.
structure ( ) : Gdn_DatabaseStructure Get a reference to the default database structure object.
themeManager ( ) : Gdn_ThemeManager Get the plugin manager for the application.
translate ( string $Code, string $Default = false ) : string Translates a code into the selected locale's definition.
userMetaModel ( ) : UserMetaModel Get a reference to the user meta model.
userModel ( ) : UserModel Get a reference to the user model.

Method Details

addonManager() public static method

Get the addon manager.
public static addonManager ( ) : AddonManager
return Vanilla\AddonManager

applicationManager() public static method

Get the application manager
public static applicationManager ( ) : Gdn_ApplicationManager
return Gdn_ApplicationManager

authenticator() public static method

public static authenticator ( ) : Gdn_Auth
return Gdn_Auth

cache() public static method

Get the cache object
public static cache ( ) : Gdn_Cache
return Gdn_Cache

config() public static method

Get a configuration setting for the application.
public static config ( string $Name = false, mixed $Default = false ) : Gdn_Configuration | mixed
$Name string The name of the configuration setting. Settings in different sections are seperated by a dot ('.')
$Default mixed The result to return if the configuration setting is not found.
return Gdn_Configuration | mixed The configuration setting.

controller() public static method

The current controller being targetted.
public static controller ( Gdn_Controller $Value = null ) : Gdn_Controller
$Value Gdn_Controller
return Gdn_Controller

database() public static method

Get a reference to the default database object.
public static database ( ) : Gdn_Database
return Gdn_Database

dispatcher() public static method

Gets the global dispatcher object.
public static dispatcher ( ) : Gdn_Dispatcher
return Gdn_Dispatcher

factory() public static method

Get an object from the factory.
See also: Gdn_Factory::Factory()
public static factory ( string $Alias = false )
$Alias string The alias of the class.

factoryExists() public static method

Checks whether or not a factory alias exists.
See also: Gdn_Factory::Exists()
public static factoryExists ( string $Alias ) : boolean
$Alias string The alias of the factory to check for.
return boolean Whether or not a factory definintion exists.

factoryInstall() public static method

Install a class to the factory.
See also: Gdn_Factory::Install()
public static factoryInstall ( string $Alias, string $ClassName, string $Path = '', string $FactoryType = self::FactorySingleton, $Data = null )
$Alias string An alias for the class that will be used to retreive instances of it.
$ClassName string The actual name of the class.
$Path string The path to the class' file. You can prefix the path with ~ to start at the application root.
$FactoryType string The way objects will be instantiated for the class. One of (Gdn::FactoryInstance, Gdn::FactoryPrototype, Gdn::FactorySingleton).

factoryInstallDependency() public static method

Installs a dependency to the factory.
See also: Gdn_Factory::InstalDependency()
public static factoryInstallDependency ( string $Alias, string $PropertyName, string $SourceAlias )
$Alias string The alias of the class that will have the dependency.
$PropertyName string The name of the property on the class that will have the dependency.
$SourceAlias string The alias of the class that will provide the value of the property when objects are instantiated.

factoryInstallDependencyFromConfig() public static method

Installs a dependency to the factory with the settings from a configuration.
public static factoryInstallDependencyFromConfig ( mixed $Config, string $Alias = null )
$Config mixed The configuration of the factory definition. This argument can be of the following types: - string: The configuration will be looked up by calling inline{@link Gdn::Config()} - array: The configuration will be set from the array.
$Alias string The class alias to install into the factory. If omitted then it must be in the configuration. The dependency will be installed from the configuration array depending on the following keys: - Alias: Optional if $Alias is passed as an argument. - PropertyName: Required. - SourceAlias: Required. - Override Optional. All of these values are passed to the corresponding argument in inline{@link Gdn::FactoryInstallDependency()}.

factoryInstallFromConfig() public static method

Installs a class to the factory with the settings from a configuration.
public static factoryInstallFromConfig ( mixed $Config, string $Alias = null )
$Config mixed The configuration of the factory definition. This argument can be of the following types: - string: The configuration will be looked up by calling inline{@link Gdn::Config()} - array: The configuration will be set from the array.
$Alias string The class alias to install into the factory. If omitted then it must be in the configuration. The factory will be installed from the configuration array depending on the following keys: - Alias: Optional if $Alias is passed as an argument. - FactoryType: Required. - Data: Optional. - Override Optional. - Dependencies Optional. Dependencies for the class can be defined as a subarray. Each item in the subarray will be passed to inline{@link Gdn::FactoryInstallDependencyFromConfig}. All of these values (except Dependencies) are passed to the corresponding argument in inline{@link Gdn::FactoryInstall()}.

factoryOverwrite() public static method

public static factoryOverwrite ( null $Value = null ) : integer
$Value null
return integer

factoryUninstall() public static method

Uninstall an class from the factory.
See also: Gdn_Factory::Uninstall()
public static factoryUninstall ( string $Alias )
$Alias string The alias of the class to uninstall.

factoryUninstallDependency() public static method

Uninstall a dependency from the factory.
See also: Gdn_Factory::UninstallDependency()
public static factoryUninstallDependency ( $Alias, $PropertyName = null )

get() public static method

public static get ( $Key, $Default = null )

installationID() public static method

Gets/Sets the Garden InstallationID
public static installationID ( string $SetInstallationID = null ) : string
$SetInstallationID string
return string Installation ID or NULL

installationSecret() public static method

Gets/Sets the Garden Installation Secret
public static installationSecret ( string $SetInstallationSecret = null ) : string
$SetInstallationSecret string
return string Installation Secret or NULL

locale() public static method

public static locale ( ) : Gdn_Locale
return Gdn_Locale

permissionModel() public static method

Get the permission model for the application.
public static permissionModel ( ) : PermissionModel
return PermissionModel

pluginManager() public static method

Get the plugin manager for the application.
public static pluginManager ( ) : Gdn_PluginManager
return Gdn_PluginManager

regarding() public static method

public static regarding ( ) : Gdn_Regarding
return Gdn_Regarding

request() public static method

Get or set the current request object.
public static request ( Gdn_Request $NewRequest = null ) : Gdn_Request
$NewRequest Gdn_Request The new request or null to just get the request.
return Gdn_Request

router() public static method

Get the router object
public static router ( ) : Gdn_Router
return Gdn_Router

session() public static method

Get the session object.
public static session ( ) : Gdn_Session
return Gdn_Session

set() public static method

public static set ( $Key, $Value = null )

setFactory() public static method

Set the object used as the factory for the api.
public static setFactory ( Gdn_Factory $Factory, boolean $Override = true )
$Factory Gdn_Factory The object used as the factory.
$Override boolean whether to override the property if it is already set.

slice() public static method

Get a reference to the Gdn_Slice
public static slice ( string $Slice ) : Gdn_Slice
$Slice string Slice to execute
return Gdn_Slice

sql() public static method

Get a reference to the default SQL driver object.
See also: Gdn_Database::SQL()
public static sql ( ) : Gdn_SQLDriver
return Gdn_SQLDriver

statistics() public static method

Get a reference to the Statistics object.
public static statistics ( ) : Gdn_Statistics
return Gdn_Statistics

structure() public static method

Get a reference to the default database structure object.
public static structure ( ) : Gdn_DatabaseStructure
return Gdn_DatabaseStructure

themeManager() public static method

Get the plugin manager for the application.
public static themeManager ( ) : Gdn_ThemeManager
return Gdn_ThemeManager

translate() public static method

Translates a code into the selected locale's definition.
public static translate ( string $Code, string $Default = false ) : string
$Code string The code related to the language-specific definition.
$Default string The default value to be displayed if the translation code is not found.
return string The translated string or $Code if there is no value in $Default.

userMetaModel() public static method

Get a reference to the user meta model.
public static userMetaModel ( ) : UserMetaModel
return UserMetaModel

userModel() public static method

Get a reference to the user model.
public static userModel ( ) : UserModel
return UserModel

Property Details

$_Config protected static property

protected static object $_Config
return object

$_Factory protected static property

The factory used to create core objects in the application.
protected static $_Factory

$_FactoryOverwrite protected static property

Whether or not Gdn::FactoryInstall should overwrite existing objects.
protected static $_FactoryOverwrite

$_Locale protected static property

protected static object $_Locale
return object

$_PluginManager protected static property

protected static object $_PluginManager
return object

$_Request protected static property

protected static object $_Request
return object

$_Session protected static property

protected static object $_Session
return object