Welcome, Guest Log In

Class Krai_Struct

Class Overview

A struct type abstract class

This class provides a sort of approximation of a struct type from some other languages. The Krai_Struct::$FIELDS variable holds the names and default values of the allowed properties. The default values are also used to determine what type the values of those properties must have.

The class uses the PHP overloading functions to control the public behavior.

Located in /Krai/Struct.php [line 32]



		
				Author(s):
		
API Tags:
Abstract:  

Properties

Methods

[ Top ]
Descendants
Child Class Description
Krai_Struct_Loginfo Log Info Struct
Krai_Struct_Dbquery Database base query struct
Krai_Struct_Mail Struct holding the information for an e-mail
Krai_Struct_Mailconf Struct holding the information for an e-mail connection
AccessScheme Structure of an Access Scheme for use with authenticating permissions.

[ Top ]
Property Summary
array   $DATA   Array of current values of the Fields
array   $FIELDS   Array of allowed properties of the struct

[ Top ]
Method Summary
Krai_Struct   __construct()   Constructor
boolean   VarAllowed()   Determine whether a property is allowed to be get / set
mixed   __get()   PHP magic function for getting a property value
void   __set()   PHP magic function for setting a property value

[ Top ]
Properties
array   $DATA = array() [line 54]

Array of current values of the Fields

This variable holds the data that currently resides in each of the allowed properties.

API Tags:
Access:  protected


[ Top ]
array   $FIELDS = array() [line 44]

Array of allowed properties of the struct

This variable holds the names and default values of the allowed properties. The default values are also used to determine what type the values of those properties must have.

API Tags:
Access:  protected


Redefined in descendants as:

[ Top ]
Methods
Constructor __construct  [line 66]

  Krai_Struct __construct( [ $new_defaults = array()]  )

Constructor

This function initializes the struct instance. It accepts overrides of the default values, in lieu of setting those values after initialization, for convenience.

Parameters:
array   $new_defaults:  Override the default values of the allowed fields

API Tags:
Access:  public


Redefined in descendants as:

[ Top ]
VarAllowed  [line 140]

  boolean VarAllowed( mixed $m  )

Determine whether a property is allowed to be get / set

This function determines, from the Krai_Struct::$FIELDS variable, whether or not a certail property is allowed.

Parameters:
mixed   $m:  The name of the property

API Tags:
Access:  protected


[ Top ]
__get  [line 94]

  mixed __get( mixed $m  )

PHP magic function for getting a property value

Returns the current value of a property, or throws a Krai_Struct_Exception if that property is not valid.

Parameters:
mixed   $m:  The name of the property of which to get the value

API Tags:
Return:  The value of the property
Access:  public

Information Tags:
Throws:  Krai_Struct_Exception

[ Top ]
__set  [line 118]

  void __set( mixed $m, mixed $v  )

PHP magic function for setting a property value

Sets the value of the property if it is allowed by the struct and if the value is of the correct type. Otherwise throws a Krai_Struct_Exception.

Parameters:
mixed   $m:  The name of the property to set
mixed   $v:  The value of the property to set

API Tags:
Access:  public

Information Tags:
Throws:  Krai_Struct_Exception

[ Top ]

Documentation generated on Fri, 25 Jul 2008 15:20:04 -0400 by phpDocumentor 1.4.2
Krai Framework site admin credits sitemap valid xhtml?