Mage_Core_Model_Url
extends DataObject
in package
URL
Properties:
-
request
-
relative_url: true, false
-
type: 'link', 'skin', 'js', 'media'
-
store: instanceof Mage_Core_Model_Store
-
secure: true, false
-
scheme: 'http', 'https'
-
user: 'user'
-
password: 'password'
-
host: 'localhost'
-
port: 80, 443
-
base_path: '/dev/magento/'
-
base_script: 'index.php'
-
storeview_path: 'storeview/'
-
route_path: 'module/controller/action/param1/value1/param2/value2'
-
route_name: 'module'
-
controller_name: 'controller'
-
action_name: 'action'
-
route_params: ['param1'=>'value1', 'param2'=>'value2']
-
query: (?)'param1=value1¶m2=value2'
-
query_array: ['param1'=>'value1', 'param2'=>'value2']
-
fragment: (#)'fragment-anchor'
URL structure:
https://user:password@host:443/base_path/[base_script][storeview_path]route_name/controller_name/action_name/param1/value1?query_param=query_value#fragment _A__/_B__/ _C__/ _D/ _E_/ _F__/ ___G/ _H/
- A: authority
- B: path
- C: absolute_base_url
- D: action_path
- E: route_params
- F: host_url
- G: route_path
- H: route_url
Table of Contents
Constants
- DEFAULT_ACTION_NAME : mixed = 'index'
- Default action name
- DEFAULT_CONTROLLER_NAME : mixed = 'index'
- Default controller name
- FORM_KEY : mixed = 'form_key'
- Param name for form key functionality
- XML_PATH_SECURE_IN_ADMIN : mixed = 'default/web/secure/use_in_adminhtml'
- XML path for using in adminhtml
- XML_PATH_SECURE_IN_FRONT : mixed = 'web/secure/use_in_frontend'
- XML path for using in frontend
- XML_PATH_SECURE_URL : mixed = 'web/secure/base_url'
- XML base url path secure
- XML_PATH_UNSECURE_URL : mixed = 'web/unsecure/base_url'
- XML base url path unsecure
Properties
- $_configDataCache : array<string|int, mixed>
- Configuration data cache
- $_data : array<string|int, mixed>|null
- Object attributes
- $_dirty : array<string|int, mixed>
- $_encryptedSessionId : string|null
- Encrypted session identifier
- $_hasDataChanges : bool
- Data changes flag (true after setData|unsetData call)
- $_idFieldName : string
- Name of object id field
- $_isDeleted : bool
- Object delete flag
- $_oldFieldsMap : array<string|int, mixed>
- Map short fields names to its full names
- $_request : Mage_Core_Controller_Request_Http
- Controller request object
- $_reservedRouteParams : array<string|int, mixed>
- Reserved Route parameter keys
- $_syncFieldsMap : mixed
- Map of fields to sync to other fields upon changing their data
- $_underscoreCache : array<string|int, mixed>
- Setter/Getter underscore transformation cache
- $_useSession : bool|null
- Use Session ID for generate URL
Methods
- __call() : mixed
- Set/Get attribute wrapper
- __construct() : mixed
- Constructor
- __get() : mixed
- Attribute getter (deprecated)
- __set() : mixed
- Attribute setter (deprecated)
- __toArray() : array<string|int, mixed>
- Convert object attributes to array
- addData() : $this
- Add data to the object.
- addSessionParam() : $this
- Add session param
- checkCookieDomains() : $this
- If the host was switched but session cookie won't recognize it - add session id to query
- debug() : string|array<string|int, mixed>
- Present object data as string in debug mode
- escape() : string
- Escape (enclosure) URL string
- flagDirty() : $this
- getActionName() : string|null
- Retrieve action name
- getActionPath() : string
- Retrieve action path
- getBaseUrl() : string
- Retrieve Base URL
- getConfigData() : string
- Retrieve configuration data
- getControllerName() : string|null
- Retrieve controller name
- getData() : mixed
- Object data getter
- getDataByKey() : mixed
- Get object data by particular key
- getDataByPath() : mixed
- Get object data by path
- getDataSetDefault() : mixed
- Fast get data or set default if value is not available
- getDataUsingMethod() : mixed
- Get object data by key with calling getter method
- getDefaultActionName() : string
- Retrieve default action name
- getDefaultControllerName() : string
- Retrieve default controller name
- getDirectUrl() : string
- Build url by direct url and parameters
- getFragment() : string|null
- Retrieve URL fragment
- getHost() : string
- getId() : mixed
- Retrieve object id
- getIdFieldName() : string
- Retrieve name of object id field
- getPath() : string
- getPort() : string
- getQuery() : string
- Get query params part of url
- getQueryParam() : mixed
- Retrieve query param
- getQueryParams() : array<string|int, mixed>
- Return Query Params
- getRebuiltUrl() : string
- Rebuild URL to handle the case when session ID was changed
- getRedirectUrl() : string
- Return frontend redirect URL with SID and other session parameters if any
- getRequest() : Mage_Core_Controller_Request_Http
- Zend request object
- getRouteFrontName() : string
- Retrieve route front name
- getRouteName() : string|null
- Retrieve route name
- getRouteParam() : mixed
- Retrieve route params
- getRouteParams() : array<string|int, mixed>
- Retrieve route params
- getRoutePath() : string
- Retrieve route path
- getRouteUrl() : string
- Retrieve route URL
- getScheme() : string
- getSecure() : bool
- Retrieve is secure mode URL
- getStore() : Mage_Core_Model_Store
- Get current store for the url instance
- getType() : string
- Retrieve URL type
- getUrl() : string
- Build url by requested path and parameters
- getUseSession() : bool
- Retrieve use session rule
- hasData() : bool
- If $key is empty, checks whether there's any data in the object Otherwise checks if the specified attribute is set.
- hasDataChanges() : bool
- Get data change status
- isDeleted() : bool
- Set _isDeleted flag value (if $isDeleted param is defined) and return current flag value
- isDirty() : bool
- isEmpty() : bool
- checks whether the object is empty
- isOwnOriginUrl() : bool
- Check if users originated URL is one of the domain URLs assigned to stores
- jsonSerialize() : array<string|int, mixed>
- Implementation of JsonSerializable::jsonSerialize()
- offsetExists() : bool
- Implementation of ArrayAccess::offsetExists()
- offsetGet() : mixed
- Implementation of ArrayAccess::offsetGet()
- offsetSet() : void
- Implementation of ArrayAccess::offsetSet()
- offsetUnset() : void
- Implementation of ArrayAccess::offsetUnset()
- parseUrl() : Mage_Core_Model_Url
- Initialize object data from retrieved url
- purgeQueryParams() : $this
- Purge Query params array
- serialize() : string
- serialize object attributes
- sessionUrlVar() : string
- Replace Session ID value in URL
- sessionVarCallback() : string
- Callback function for session replace
- setActionName() : $this
- Set Action name Reset route path if action name has changed
- setControllerName() : $this
- Set Controller Name
- setData() : $this
- Overwrite data in the object.
- setDataChanges() : $this
- Clears data changes status
- setDataUsingMethod() : $this
- Set object data with calling setter method
- setFragment() : $this
- Set fragment to URL
- setId() : $this
- Set object id field value
- setIdFieldName() : $this
- set name of object id field
- setQuery() : $this
- Set URL query param(s)
- setQueryParam() : $this
- Set query param
- setQueryParams() : $this
- Set query Params as array
- setRequest() : $this
- Set request
- setRouteFrontName() : $this
- Set route front name
- setRouteName() : $this
- Set route name
- setRouteParam() : $this
- Set route param
- setRouteParams() : $this
- Set route params
- setRoutePath() : $this
- Set Route Parameters
- setSecure() : $this
- setSecureIsForced() : $this
- setStore() : $this
- Set store entity
- setType() : $this
- setUseSession() : $this
- Set use session rule
- setUseUrlCache() : $this
- Set use_url_cache flag
- toArray() : array<string|int, mixed>
- Public wrapper for __toArray
- toJson() : string
- Public wrapper for __toJson
- toString() : string
- Public wrapper for __toString
- toXml() : string
- Public wrapper for __toXml
- unsetData() : $this
- Unset data from the object.
- unsetOldData() : $this
- Unset old fields data from the object.
- useSessionIdForUrl() : bool
- Check and return use SID for URL
- __toJson() : string
- Convert object attributes to JSON
- __toXml() : string
- Convert object attributes to XML
- _addFullNames() : mixed
- _camelize() : string
- _construct() : void
- Initialize object
- _generateSymfonyRoutePath() : string|null
- Try to generate a URL path using the opcached CompiledUrlGenerator.
- _getData() : mixed
- Get value from _data array without parse key
- _initOldFieldsMap() : mixed
- Inits mapping array of object's previously used fields to new fields.
- _prepareArray() : array<string|int, mixed>
- Set required array elements
- _prepareSessionUrl() : $this
- Check and add session id to URL
- _prepareSessionUrlWithParams() : $this
- Check and add session id to URL, session is obtained with parameters
- _prepareSyncFieldsMap() : $this
- Called after old fields are inited. Forms synchronization map to sync old fields and new fields between each other.
- _underscore() : string
- Converts field names for setters and getters
Constants
DEFAULT_ACTION_NAME
Default action name
public
mixed
DEFAULT_ACTION_NAME
= 'index'
DEFAULT_CONTROLLER_NAME
Default controller name
public
mixed
DEFAULT_CONTROLLER_NAME
= 'index'
FORM_KEY
Param name for form key functionality
public
mixed
FORM_KEY
= 'form_key'
XML_PATH_SECURE_IN_ADMIN
XML path for using in adminhtml
public
mixed
XML_PATH_SECURE_IN_ADMIN
= 'default/web/secure/use_in_adminhtml'
XML_PATH_SECURE_IN_FRONT
XML path for using in frontend
public
mixed
XML_PATH_SECURE_IN_FRONT
= 'web/secure/use_in_frontend'
XML_PATH_SECURE_URL
XML base url path secure
public
mixed
XML_PATH_SECURE_URL
= 'web/secure/base_url'
XML_PATH_UNSECURE_URL
XML base url path unsecure
public
mixed
XML_PATH_UNSECURE_URL
= 'web/unsecure/base_url'
Properties
$_configDataCache
Configuration data cache
protected
static array<string|int, mixed>
$_configDataCache
$_data
Object attributes
protected
array<string|int, mixed>|null
$_data
= []
$_dirty
protected
array<string|int, mixed>
$_dirty
$_encryptedSessionId
Encrypted session identifier
protected
static string|null
$_encryptedSessionId
$_hasDataChanges
Data changes flag (true after setData|unsetData call)
protected
bool
$_hasDataChanges
= false
$_idFieldName
Name of object id field
protected
string
$_idFieldName
= null
$_isDeleted
Object delete flag
protected
bool
$_isDeleted
= false
$_oldFieldsMap
Map short fields names to its full names
protected
array<string|int, mixed>
$_oldFieldsMap
= []
$_request
Controller request object
protected
Mage_Core_Controller_Request_Http
$_request
$_reservedRouteParams
Reserved Route parameter keys
protected
array<string|int, mixed>
$_reservedRouteParams
= ['_store', '_type', '_secure', '_forced_secure', '_use_rewrite', '_nosid', '_absolute', '_current', '_direct', '_fragment', '_escape', '_query', '_store_to_url']
$_syncFieldsMap
Map of fields to sync to other fields upon changing their data
protected
mixed
$_syncFieldsMap
= []
$_underscoreCache
Setter/Getter underscore transformation cache
protected
static array<string|int, mixed>
$_underscoreCache
= []
$_useSession
Use Session ID for generate URL
protected
bool|null
$_useSession
Methods
__call()
Set/Get attribute wrapper
public
__call(string $method, array<string|int, mixed> $args) : mixed
Parameters
- $method : string
- $args : array<string|int, mixed>
__construct()
Constructor
public
__construct() : mixed
By default, is looking for first argument as array and assigns it as object attributes This behaviour may change in child classes
__get()
Attribute getter (deprecated)
public
__get(string $var) : mixed
Parameters
- $var : string
__set()
Attribute setter (deprecated)
public
__set(string $var, mixed $value) : mixed
Parameters
- $var : string
- $value : mixed
__toArray()
Convert object attributes to array
public
__toArray([array<string|int, mixed> $arrAttributes = [] ]) : array<string|int, mixed>
Parameters
- $arrAttributes : array<string|int, mixed> = []
-
array of required attributes
Return values
array<string|int, mixed>addData()
Add data to the object.
public
addData(array<string|int, mixed> $arr) : $this
Retains previous data in the object.
Parameters
- $arr : array<string|int, mixed>
Return values
$thisaddSessionParam()
Add session param
public
addSessionParam() : $this
Return values
$thischeckCookieDomains()
If the host was switched but session cookie won't recognize it - add session id to query
public
checkCookieDomains() : $this
Return values
$thisdebug()
Present object data as string in debug mode
public
debug([mixed $data = null ][, array<string|int, mixed> &$objects = [] ]) : string|array<string|int, mixed>
Parameters
- $data : mixed = null
- $objects : array<string|int, mixed> = []
Return values
string|array<string|int, mixed>escape()
Escape (enclosure) URL string
public
escape(string $value) : string
Parameters
- $value : string
Return values
stringflagDirty()
public
flagDirty(string $field[, bool $flag = true ]) : $this
Parameters
- $field : string
- $flag : bool = true
Return values
$thisgetActionName()
Retrieve action name
public
getActionName() : string|null
Return values
string|nullgetActionPath()
Retrieve action path
public
getActionPath() : string
Return values
stringgetBaseUrl()
Retrieve Base URL
public
getBaseUrl([array<string|int, mixed> $params = [] ]) : string
Parameters
- $params : array<string|int, mixed> = []
Return values
stringgetConfigData()
Retrieve configuration data
public
getConfigData(string $key[, string|null $prefix = null ]) : string
Parameters
- $key : string
- $prefix : string|null = null
Return values
stringgetControllerName()
Retrieve controller name
public
getControllerName() : string|null
Return values
string|nullgetData()
Object data getter
public
getData([string $key = '' ][, string|int $index = null ]) : mixed
If $key is not defined will return all the data as an array. Otherwise, it will return value of the element specified by $key. It is possible to use keys like a/b/c for access nested array data
If $index is specified it will assume that attribute data is an array and retrieve corresponding member. If data is the string - it will be explode by new line character and converted to array.
Parameters
- $key : string = ''
- $index : string|int = null
getDataByKey()
Get object data by particular key
public
getDataByKey(string $key) : mixed
Parameters
- $key : string
getDataByPath()
Get object data by path
public
getDataByPath(string $path) : mixed
Method consider the path as chain of keys: a/b/c => ['a']['b']['c']
Parameters
- $path : string
getDataSetDefault()
Fast get data or set default if value is not available
public
getDataSetDefault(string $key, mixed $default) : mixed
Parameters
- $key : string
- $default : mixed
getDataUsingMethod()
Get object data by key with calling getter method
public
getDataUsingMethod(string $key[, mixed $args = null ]) : mixed
Parameters
- $key : string
- $args : mixed = null
getDefaultActionName()
Retrieve default action name
public
getDefaultActionName() : string
Return values
stringgetDefaultControllerName()
Retrieve default controller name
public
getDefaultControllerName() : string
Return values
stringgetDirectUrl()
Build url by direct url and parameters
public
getDirectUrl(string $url[, array<string|int, mixed> $params = [] ]) : string
Parameters
- $url : string
- $params : array<string|int, mixed> = []
Return values
stringgetFragment()
Retrieve URL fragment
public
getFragment() : string|null
Return values
string|nullgetHost()
public
getHost() : string
Return values
stringgetId()
Retrieve object id
public
getId() : mixed
getIdFieldName()
Retrieve name of object id field
public
getIdFieldName() : string
Return values
stringgetPath()
public
getPath() : string
Return values
stringgetPort()
public
getPort() : string
Return values
stringgetQuery()
Get query params part of url
public
getQuery([bool $escape = false ]) : string
Parameters
- $escape : bool = false
-
"&" escape flag
Return values
stringgetQueryParam()
Retrieve query param
public
getQueryParam(string $key) : mixed
Parameters
- $key : string
getQueryParams()
Return Query Params
public
getQueryParams() : array<string|int, mixed>
Return values
array<string|int, mixed>getRebuiltUrl()
Rebuild URL to handle the case when session ID was changed
public
getRebuiltUrl(string $url) : string
Parameters
- $url : string
Return values
stringgetRedirectUrl()
Return frontend redirect URL with SID and other session parameters if any
public
getRedirectUrl(string $url) : string
Parameters
- $url : string
Return values
stringgetRequest()
Zend request object
public
getRequest() : Mage_Core_Controller_Request_Http
Return values
Mage_Core_Controller_Request_HttpgetRouteFrontName()
Retrieve route front name
public
getRouteFrontName() : string
Return values
stringgetRouteName()
Retrieve route name
public
getRouteName() : string|null
Return values
string|nullgetRouteParam()
Retrieve route params
public
getRouteParam(string $key) : mixed
Parameters
- $key : string
getRouteParams()
Retrieve route params
public
getRouteParams() : array<string|int, mixed>
Return values
array<string|int, mixed>getRoutePath()
Retrieve route path
public
getRoutePath([array<string|int, mixed> $routeParams = [] ]) : string
Parameters
- $routeParams : array<string|int, mixed> = []
Return values
stringgetRouteUrl()
Retrieve route URL
public
getRouteUrl([string $routePath = null ][, array<string|int, mixed> $routeParams = null ]) : string
Parameters
- $routePath : string = null
- $routeParams : array<string|int, mixed> = null
Return values
stringgetScheme()
public
getScheme() : string
Return values
stringgetSecure()
Retrieve is secure mode URL
public
getSecure() : bool
Return values
boolgetStore()
Get current store for the url instance
public
getStore() : Mage_Core_Model_Store
Return values
Mage_Core_Model_StoregetType()
Retrieve URL type
public
getType() : string
Return values
stringgetUrl()
Build url by requested path and parameters
public
getUrl([string|null $routePath = null ][, array<string|int, mixed>|null $routeParams = null ]) : string
Parameters
- $routePath : string|null = null
- $routeParams : array<string|int, mixed>|null = null
Return values
stringgetUseSession()
Retrieve use session rule
public
getUseSession() : bool
Return values
boolhasData()
If $key is empty, checks whether there's any data in the object Otherwise checks if the specified attribute is set.
public
hasData([string $key = '' ]) : bool
Parameters
- $key : string = ''
Return values
boolhasDataChanges()
Get data change status
public
hasDataChanges() : bool
Return values
boolisDeleted()
Set _isDeleted flag value (if $isDeleted param is defined) and return current flag value
public
isDeleted([bool $isDeleted = null ]) : bool
Parameters
- $isDeleted : bool = null
Return values
boolisDirty()
public
isDirty([string $field = null ]) : bool
Parameters
- $field : string = null
Return values
boolisEmpty()
checks whether the object is empty
public
isEmpty() : bool
Return values
boolisOwnOriginUrl()
Check if users originated URL is one of the domain URLs assigned to stores
public
isOwnOriginUrl() : bool
Return values
booljsonSerialize()
Implementation of JsonSerializable::jsonSerialize()
public
jsonSerialize() : array<string|int, mixed>
Prepares the object data for JSON serialization. Returns all object data as an array, with special handling for nested DataObject instances:
- If a nested DataObject has a custom jsonSerialize() implementation, it's preserved as-is
- If a nested DataObject has a custom toJson() method, it's converted to JSON string
- If a nested DataObject uses only the base implementations, it's excluded from output
This prevents infinite recursion and circular references when serializing object hierarchies.
Attributes
- #[Override]
Return values
array<string|int, mixed>offsetExists()
Implementation of ArrayAccess::offsetExists()
public
offsetExists(string $offset) : bool
Parameters
- $offset : string
Tags
Attributes
- #[Override]
Return values
booloffsetGet()
Implementation of ArrayAccess::offsetGet()
public
offsetGet(string $offset) : mixed
Parameters
- $offset : string
Tags
Attributes
- #[Override]
- #[ReturnTypeWillChange]
offsetSet()
Implementation of ArrayAccess::offsetSet()
public
offsetSet(string $offset, mixed $value) : void
Parameters
- $offset : string
- $value : mixed
Tags
Attributes
- #[Override]
offsetUnset()
Implementation of ArrayAccess::offsetUnset()
public
offsetUnset(string $offset) : void
Parameters
- $offset : string
Tags
Attributes
- #[Override]
parseUrl()
Initialize object data from retrieved url
public
parseUrl(string $url) : Mage_Core_Model_Url
Parameters
- $url : string
Return values
Mage_Core_Model_UrlpurgeQueryParams()
Purge Query params array
public
purgeQueryParams() : $this
Return values
$thisserialize()
serialize object attributes
public
serialize([array<string|int, mixed> $attributes = [] ][, string $valueSeparator = '=' ][, string $fieldSeparator = ' ' ][, string $quote = '"' ]) : string
Parameters
- $attributes : array<string|int, mixed> = []
- $valueSeparator : string = '='
- $fieldSeparator : string = ' '
- $quote : string = '"'
Return values
stringsessionUrlVar()
Replace Session ID value in URL
public
sessionUrlVar(string $html) : string
Parameters
- $html : string
Return values
stringsessionVarCallback()
Callback function for session replace
public
sessionVarCallback(array<string|int, mixed> $match) : string
Parameters
- $match : array<string|int, mixed>
Return values
stringsetActionName()
Set Action name Reset route path if action name has changed
public
setActionName(string $data) : $this
Parameters
- $data : string
Return values
$thissetControllerName()
Set Controller Name
public
setControllerName(string $data) : $this
Reset action name and route path if has change
Parameters
- $data : string
Return values
$thissetData()
Overwrite data in the object.
public
setData(string|array<string|int, mixed> $key[, mixed $value = null ]) : $this
$key can be string or array. If $key is string, the attribute value will be overwritten by $value
If $key is an array, it will overwrite all the data in the object.
Parameters
- $key : string|array<string|int, mixed>
- $value : mixed = null
Return values
$thissetDataChanges()
Clears data changes status
public
setDataChanges(bool $value) : $this
Parameters
- $value : bool
Return values
$thissetDataUsingMethod()
Set object data with calling setter method
public
setDataUsingMethod(string $key[, mixed $args = [] ]) : $this
Parameters
- $key : string
- $args : mixed = []
Return values
$thissetFragment()
Set fragment to URL
public
setFragment(string $data) : $this
Parameters
- $data : string
Return values
$thissetId()
Set object id field value
public
setId(mixed $value) : $this
Parameters
- $value : mixed
Return values
$thissetIdFieldName()
set name of object id field
public
setIdFieldName(string $name) : $this
Parameters
- $name : string
Return values
$thissetQuery()
Set URL query param(s)
public
setQuery(mixed $data) : $this
Parameters
- $data : mixed
Return values
$thissetQueryParam()
Set query param
public
setQueryParam(string $key, mixed $data) : $this
Parameters
- $key : string
- $data : mixed
Return values
$thissetQueryParams()
Set query Params as array
public
setQueryParams(array<string|int, mixed> $data) : $this
Parameters
- $data : array<string|int, mixed>
Return values
$thissetRequest()
Set request
public
setRequest(Mage_Core_Controller_Request_Http $request) : $this
Parameters
- $request : Mage_Core_Controller_Request_Http
Return values
$thissetRouteFrontName()
Set route front name
public
setRouteFrontName(string $name) : $this
Parameters
- $name : string
Return values
$thissetRouteName()
Set route name
public
setRouteName(string $data) : $this
Parameters
- $data : string
Return values
$thissetRouteParam()
Set route param
public
setRouteParam(string $key, mixed $data) : $this
Parameters
- $key : string
- $data : mixed
Return values
$thissetRouteParams()
Set route params
public
setRouteParams(array<string|int, mixed> $data[, bool $unsetOldParams = true ]) : $this
Parameters
- $data : array<string|int, mixed>
- $unsetOldParams : bool = true
Return values
$thissetRoutePath()
Set Route Parameters
public
setRoutePath(array<string|int, mixed>|string $data) : $this
Parameters
- $data : array<string|int, mixed>|string
Return values
$thissetSecure()
public
setSecure(bool $value) : $this
Parameters
- $value : bool
Return values
$thissetSecureIsForced()
public
setSecureIsForced(bool $value) : $this
Parameters
- $value : bool
Return values
$thissetStore()
Set store entity
public
setStore(mixed $data) : $this
Parameters
- $data : mixed
Return values
$thissetType()
public
setType(string $value) : $this
Parameters
- $value : string
Return values
$thissetUseSession()
Set use session rule
public
setUseSession(bool $useSession) : $this
Parameters
- $useSession : bool
Return values
$thissetUseUrlCache()
Set use_url_cache flag
public
setUseUrlCache(bool $flag) : $this
Parameters
- $flag : bool
Return values
$thistoArray()
Public wrapper for __toArray
public
toArray([array<string|int, mixed> $arrAttributes = [] ]) : array<string|int, mixed>
Parameters
- $arrAttributes : array<string|int, mixed> = []
Return values
array<string|int, mixed>toJson()
Public wrapper for __toJson
public
toJson([array<string|int, mixed> $arrAttributes = [] ]) : string
Parameters
- $arrAttributes : array<string|int, mixed> = []
Return values
stringtoString()
Public wrapper for __toString
public
toString([string $format = '' ]) : string
Will use $format as an template and substitute {{key}} for attributes
Parameters
- $format : string = ''
Return values
stringtoXml()
Public wrapper for __toXml
public
toXml([array<string|int, mixed> $arrAttributes = [] ][, string $rootName = 'item' ][, bool $addOpenTag = false ][, bool $addCdata = true ]) : string
Parameters
- $arrAttributes : array<string|int, mixed> = []
- $rootName : string = 'item'
- $addOpenTag : bool = false
- $addCdata : bool = true
Return values
stringunsetData()
Unset data from the object.
public
unsetData([string $key = null ]) : $this
$key can be a string only. Array will be ignored.
Parameters
- $key : string = null
Return values
$thisunsetOldData()
Unset old fields data from the object.
public
unsetOldData([string $key = null ]) : $this
$key can be a string only. Array will be ignored.
Parameters
- $key : string = null
Return values
$thisuseSessionIdForUrl()
Check and return use SID for URL
public
useSessionIdForUrl([bool $secure = false ]) : bool
Parameters
- $secure : bool = false
Return values
bool__toJson()
Convert object attributes to JSON
protected
__toJson([array<string|int, mixed> $arrAttributes = [] ]) : string
Parameters
- $arrAttributes : array<string|int, mixed> = []
-
array of required attributes
Return values
string__toXml()
Convert object attributes to XML
protected
__toXml([array<string|int, mixed> $arrAttributes = [] ][, string $rootName = 'item' ][, bool $addOpenTag = false ][, bool $addCdata = true ]) : string
Parameters
- $arrAttributes : array<string|int, mixed> = []
-
array of required attributes
- $rootName : string = 'item'
-
name of the root element
- $addOpenTag : bool = false
- $addCdata : bool = true
Return values
string_addFullNames()
protected
_addFullNames() : mixed
_camelize()
protected
_camelize(string $name) : string
Parameters
- $name : string
Return values
string_construct()
Initialize object
protected
_construct() : void
Attributes
- #[Override]
_generateSymfonyRoutePath()
Try to generate a URL path using the opcached CompiledUrlGenerator.
protected
_generateSymfonyRoutePath() : string|null
Path variables are substituted by Symfony. Extras are appended manually:
admin URLs use key/value path segments (captured at match time by {_catchall}),
frontend URLs use query parameters.
Return values
string|null —The route path (without leading slash, with trailing slash), or null to fall back to legacy
_getData()
Get value from _data array without parse key
protected
_getData(string $key) : mixed
Parameters
- $key : string
_initOldFieldsMap()
Inits mapping array of object's previously used fields to new fields.
protected
_initOldFieldsMap() : mixed
Must be overloaded by descendants to set concrete fields map.
_prepareArray()
Set required array elements
protected
_prepareArray(array<string|int, mixed> &$arr[, array<string|int, mixed> $elements = [] ]) : array<string|int, mixed>
Parameters
- $arr : array<string|int, mixed>
- $elements : array<string|int, mixed> = []
Return values
array<string|int, mixed>_prepareSessionUrl()
Check and add session id to URL
protected
_prepareSessionUrl(string $url) : $this
Parameters
- $url : string
Return values
$this_prepareSessionUrlWithParams()
Check and add session id to URL, session is obtained with parameters
protected
_prepareSessionUrlWithParams(string $url, array<string|int, mixed> $params) : $this
Parameters
- $url : string
- $params : array<string|int, mixed>
Return values
$this_prepareSyncFieldsMap()
Called after old fields are inited. Forms synchronization map to sync old fields and new fields between each other.
protected
_prepareSyncFieldsMap() : $this
Return values
$this_underscore()
Converts field names for setters and getters
protected
_underscore(string $name) : string
$this->setMyField($value) === $this->setData('my_field', $value) Uses cache to eliminate unnecessary preg_replace
Parameters
- $name : string