xplo.re Medusa Core Framework 3.2
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Event
  • Todo
  • Download

Namespaces

  • Core
    • Authentication
      • Auto
        • Driver
      • Driver
    • Cache
      • Driver
    • Charset
      • Driver
    • Configuration
      • Driver
    • Controller
    • Converter
      • Driver
    • Decoder
      • Driver
    • Encoder
      • Driver
    • Env
      • Authentication
      • Locale
      • Proxy
      • Server
        • HTTP
        • Redirect
        • X
    • Exception
    • Exchange
      • Driver
    • Fault
      • Formatter
        • Driver
      • Incident
        • Exception
      • Reporter
        • Driver
    • Field
    • Filter
      • Driver
    • Formatter
      • Driver
        • coreuimarkup
          • Token
    • Hash
    • Loader
    • Locale
    • Log
      • Driver
    • Module
      • Dependency
        • Requirement
          • Core
          • PHP
      • Linkage
        • Driver
    • PDF
    • Plugin
    • Query
      • Driver
    • Server
      • Driver
    • Session
      • Driver
    • Set
    • Storage
      • Driver
      • Field
        • Element
    • Stream
      • Driver
    • String
    • Translation
      • Driver
      • Language
        • Driver
    • Type
    • URI
      • Driver
    • Version
    • View
      • Driver
        • coreui
          • Control
            • Button
            • Table
          • Element
        • htmlbuilder
          • Tags
        • yui
          • Modules
  • None
  • PHP

Classes

  • Authentication
  • Authentication_Token
  • AutoLoader
  • Cache
  • Charset
  • ClassDescriptor
  • Closure
  • Configuration
  • Controller
  • Converter
  • Date
  • Decoder
  • Delegate
  • Dispatcher
  • Encoder
  • Env
  • Env_Field
  • Env_File
  • Env_FileList
  • Env_Request
  • Env_SERVER
  • Exchange
  • Fault
  • Field
  • Filter
  • Filter_Value
  • Formatter
  • Hash
  • IP
  • Loader
  • Locale
  • Locale_Node
  • Log
  • Module
  • Module_Iterator
  • Nothing
  • Object
  • OS
  • Plugin
  • Profiler
  • Query
  • Registry
  • Resource
  • Server
  • Session
  • Session_Token
  • Set
  • Storage
  • Storage_Result
  • Storage_Statement
  • Stream
  • Translation
  • URI
  • URI_Parameters
  • UUID
  • Value
  • Version
  • View

Interfaces

  • Accessor
  • Chainable
  • Comparable
  • Configurable
  • Equality
  • Identity
  • Inquiry
  • Masquerade
  • Mutator
  • SeekableStream
  • Storable
  • Variator

Exceptions

  • Exception

Constants

  • Copyright
  • ProductName
  • Version

Class Field

A Field is a proxy object to an immutable (dynamic) data storage. Data storage access is available via array access or the Core\Field::getDataForKey() method. Field properties are separated from the data core, accessible through properties and KVC access inherited by Core\Set, and contain object specific values.

Thus a Field represents a complex object with a separated data storage. Parameter values are always associative with the object, and array values are fetched from the data storage.

Fields support an internal data cache to reduce access to their (external) data storage; subclasses may prefetch data values and the default implementation will automatically provide these on request before calling the reimplemented dynamic data accessor method.

Core\Object implements Core\Chainable
Extended by Core\Set implements Core\Accessor
Extended by Core\Set\Mutable implements Core\Mutator
Extended by Core\Field implements Core\Inquiry

Direct known subclasses

Core\Converter, Core\Decoder, Core\Translation\Language_Node, Core\Version, Core\Encoder, Core\Env_Field, Core\Exchange\Matrix_Import, Core\Field\Mutable, Core\Filter, Core\Locale_Node, Core\Storage_Result, Core\Translation\Language

Indirect known subclasses

Core\Authentication\Driver\ldap_Token, Core\Authentication\Driver\sspi_Token, Core\Decoder\Driver\base64, Core\Decoder\Driver\base64s, Core\Decoder\Driver\boolean, Core\Decoder\Driver\charset, Core\Decoder\Driver\decimal, Core\Decoder\Driver\delegate, Core\Decoder\Driver\html, Core\Decoder\Driver\integer, Core\Decoder\Driver\passthrough, Core\Decoder\Driver\rawurl, Core\Authentication\Driver\storage_Token, Core\Decoder\Driver\serialize, Core\Decoder\Driver\url, Core\Decoder\Driver\uu, Core\Encoder\Driver\base16, Core\Encoder\Driver\base16uppercase, Core\Encoder\Driver\base64, Core\Encoder\Driver\base64s, Core\Encoder\Driver\boolean, Core\Encoder\Driver\charset, Core\Encoder\Driver\clear, Core\Authentication_Token, Core\Encoder\Driver\crc32, Core\Encoder\Driver\decimal, Core\Encoder\Driver\delegate, Core\Encoder\Driver\escape, Core\Encoder\Driver\escapestring, Core\Encoder\Driver\hash, Core\Encoder\Driver\html, Core\Encoder\Driver\integer, Core\Encoder\Driver\md5, Core\Encoder\Driver\md5sum, Core\Configuration, Core\Encoder\Driver\passthrough, Core\Encoder\Driver\qp, Core\Encoder\Driver\rawurl, Core\Encoder\Driver\serialize, Core\Encoder\Driver\sha, Core\Encoder\Driver\sha1, Core\Encoder\Driver\sha1sum, Core\Encoder\Driver\smd5, Core\Encoder\Driver\split, Core\Encoder\Driver\ssha, Core\Configuration\Driver\constant, Core\Encoder\Driver\taggedhash, Core\Encoder\Driver\url, Core\Encoder\Driver\uu, Core\Encoder\Driver\xml, Core\Env_SERVER, Core\Exchange\Driver\csv_Import, Core\Filter\Driver\email, Core\Session_Token, Core\Storage\Driver\mysql_Result, Core\Storage\Driver\mysql_Result_Statement, Core\Configuration\Driver\ini, Core\Storage\Driver\odbc_Result, Core\Storage\Driver\sqlite2_Result, Core\Storage\Driver\sqlite3_Result, Core\Storage\Field, Core\Storage\Field\Aggregate, Core\Storage\Field\Element, Core\Storage\Field\Element\Pair, Core\Storage\Field\Element\Retained, Core\Storage\SQL_Result, Core\Translation\Language\Driver\xml, Core\Configuration\Driver\yaml, Core\Translation\Language\Driver\xml_Node, Core\View, Core\View\Driver\coreui, Core\View\Driver\html, Core\View\Driver\htmlbuilder, Core\View\Driver\plain, Core\View\Driver\yui, Core\Converter\Driver\vardump, Core\Decoder\Driver\base16

Namespace: Core
Package: Core\KDC
Since: 3.0
Requires: PHP 5.3
Version: 1.0
Located at Field.inc.php

Methods summary

public mixed
# getDataForKey( string $key )

Retrieves a KDC data storage field for a specified key. Values are retrieved from sources in the following order:

Retrieves a KDC data storage field for a specified key. Values are retrieved from sources in the following order:

  • If a cached value with the same key in the field cache exists, its value is returned;

  • otherwise the method readKey is called;

  • if no such method exists, Core\Field::getDataForUndefinedKey() is called.

Subclasses in general should not override the default behaviour of this method; instead prefetch data fields or provide read methods for specific keys. To dynamically process keys, implement Core\Field::getDataForUndefinedKey().

Parameters

$key
Name of KDC field to return value for.

Returns

mixed
Retrieved data field value.

Throws

Core\Exception\UndefinedKey
Requested data field does not exist.

See

Core\Field::getDataForUndefinedKey()

Since

3.0

Implementation of

Core\Inquiry::getDataForKey()
public mixed
# getDataForUndefinedKey( string $key )

Retrieves a KDC data storage field for an unknown key.

Retrieves a KDC data storage field for an unknown key.

Parameters

$key
Name of KDC data storage field to return value for.

Returns

mixed
Retrieved data storage field value.

Throws

Core\Exception\UndefinedKey
Failed to resolve data field for the given key.

Remark

The default implementation throws Core\Exception\UndefinedKey; subclasses should implement an own version of this method to provide dynamic access to their data storage backend. This method is always called, when Core\Field::getDataForKey() fails.

Subclasses implementing Core\Field::getDataForUndefinedKey() should also provide an own implementation for Core\Field::issetDataForKey().


See

Core\Field::getDataForKey()

Since

3.0
public array
# getDataForKeys( array $keys )

Retrieves KDC data storage fields for an array of keys.

Retrieves KDC data storage fields for an array of keys.

The default implementation calls Core\Field::getDataForKey() for each key. Subclasses should override this method with an optimised version.

Parameters

$keys
Array of data storage field names to return values for.

Returns

array
Dictionary of retrieved KDC data storage fields.

Throws

Core\Exception\UndefinedKey
Failed to resolve KDC data storage field for at least one key.

Since

3.0

Implementation of

Core\Inquiry::getDataForKeys()
public boolean
# issetDataForKey( string $key )

Tests, whether a KDC data storage field exists.

Tests, whether a KDC data storage field exists.

Parameters

$key
Name of KDC data storage field to check for existence.

Returns

boolean

true, if a KDC data storage field with the given key exists, otherwise false.

Remark

The default implementation cannot test, if Core\Field::getDataForUndefinedKey() can handle the given key; subclasses implementing Core\Field::getDataForUndefinedKey() should also provide an own implementation of Core\Field::issetDataForKey().


See

Core\Field::getDataForUndefinedKey()

Since

3.0

Implementation of

Core\Inquiry::issetDataForKey()
public boolean
# offsetExists( string $key )

Tests, whether a KDC data storage value exists. Allows the use of the isset() function for array-like access to KDC indices.

Tests, whether a KDC data storage value exists. Allows the use of the isset() function for array-like access to KDC indices.

Parameters

$key
Name of KDC data storage field to check for existence.

Returns

boolean

true, if a KDC data storage field with the given key exists, otherwise false.

Remark

The default implementation equals a call to Core\Field::issetDataForKey().

See

Core\Field::issetDataForKey()

Since

3.0

Implementation of

ArrayAccess::offsetExists()
public mixed
# offsetGet( string $key )

Retrieves a value from the KDC data storage and allows array-like access to field values.

Retrieves a value from the KDC data storage and allows array-like access to field values.

Parameters

$key
Name of KDC data storage field to return value for.

Returns

mixed
Retrieved KDC data storage field value.

Throws

Core\Exception\UndefinedKey
Requested KDC data storage field does not exist.

Remark

The default implementation equals a call to the Core\Field::getDataForKey() method.


See

Core\Field::getDataForKey()

Since

3.0

Implementation of

ArrayAccess::offsetGet()
public
# offsetSet( string $key, mixed $value )

Not available for immutable Field instances; raises an exception.

Not available for immutable Field instances; raises an exception.

Parameters

$key
$value

Throws

Core\Exception\MutationAttempt
Write access denied to immutable Field instance.

Since

3.0

Implementation of

ArrayAccess::offsetSet()
public
# offsetUnset( string $key )

Not available for immutable Field instances; raises an exception.

Not available for immutable Field instances; raises an exception.

Parameters

$key

Throws

Core\Exception\MutationAttempt
Write access denied to immutable Field instance.

Since

3.0

Implementation of

ArrayAccess::offsetUnset()

Methods inherited from Core\Set\Mutable

__set(), __unset()

Methods inherited from Core\Set

__get(), __isset()

Methods inherited from Core\Object

__autocreateFactory(), __call(), __processParameters(), __toString(), attachMethod(), chain(), getValueForKey(), getValueForKeyPath(), getValueForUndefinedKey(), hash(), issetValueForKey(), setValueForKey(), setValueForKeyPath(), setValueForUndefinedKey(), uuid()

Constants summary

Constants inherited from Core\Object

AnyParameterType, AutochainParameterType, AutocreateParameterType, BooleanParameterType, CharParameterType, EnumParameterType, IntegerParameterType, RealParameterType, StringParameterType, UserParameterType

Properties summary

protected array $_v_data

Data storage cache. Depending on the actual implementation this array can store all data fields or only cache a subset of data fields. Do not assume that all data is cached and refer to the subclass implementation for details.

Data storage cache. Depending on the actual implementation this array can store all data fields or only cache a subset of data fields. Do not assume that all data is cached and refer to the subclass implementation for details.

Since

3.0
# array ()

Magic properties

public read-only array $data

Field data storage cache. The actual use of the cache depends on the actual implementation and may either store all data, a cached copy, a cached subset or no data at all. Refer to the documentation of the actual implementation for further details prior use.

Magic properties inherited from Core\Object

$hash, $uuid

xplo.re Medusa Core Framework 3.2 API documentation generated by ApiGen