phpPeanuts  2.2.0
phpPeanuts framework
 All Data Structures Namespaces Files Functions Variables
Public Member Functions | Static Public Member Functions | Data Fields
PntPropertyDescriptor Class Reference

Inherits PntDescriptor.

Inherited by PntDerivedPropertyDescriptor, and PntFieldPropertyDescriptor.

Public Member Functions

 __construct ($name, $type, $readOnly, $minValue, $maxValue, $minLength, $maxLength, $classDir)
 
 getName ()
 
 setName ($aString)
 
 isLegalType ($aString)
 
 getType ()
 
 setType ($aString)
 
 getReadOnly ()
 
 setReadOnly ($aValue)
 
 getMinValue ()
 
 setMinValue ($aValue)
 
 getMaxValue ()
 
 setMaxValue ($aValue)
 
 getMinLength ()
 
 setMinLength ($aValue)
 
 getMaxLength ()
 
 setMaxLength ($aValue)
 
 getPersistent ()
 
 getDbSortPaths ()
 
 setDbSortPaths ($paths)
 
 getClassDir ()
 
 setClassDir ($value)
 
 getOwner ()
 
 setOwner ($anPntClassDescriptor)
 
 getValueValidator ()
 
 getVisible ()
 
 setVisible ($value)
 
 getHoldsId ()
 
 getCompulsory ()
 
 isDerived ()
 
 isFieldProperty ()
 
 isTypePrimitive ()
 
 isMultiValue ()
 
 getIdPropertyDescriptor ()
 
 __toString ()
 
 getValueFor ($obj, $filter=true)
 
 setValue_for ($value, $obj)
 
 getOptionsFor ($obj, $filter=true)
 
 hasOptionsGetter ($obj)
 
 getOptionsFilter ($obj, $filter)
 
 deriveValueFor ($obj)
 
 propagateValue_for ($value, $obj)
 
 isValueInOptionsOf ($obj, $filter=false)
 
 isValue_in ($value, $someObjects)
 
 _getValueFor ($obj)
 
 _setValue_for ($value, $obj)
 
 _getOptionsFor ($obj)
 
 _deriveValueFor ($obj)
 
 _propagateValue_for ($value, $obj)
 
 _getValueValidator ()
 
- Public Member Functions inherited from PntDescriptor
 getName ()
 
 setName ($aString)
 
 getLabel ()
 
 setLabel ($aString)
 
 __toString ()
 
 toString ()
 

Static Public Member Functions

static primitiveTypes ()
 

Data Fields

 $name
 
 $type
 
 $minValue
 
 $maxValue
 
 $minLength = 0
 
 $maxLength
 
 $readOnly
 
 $ownerName
 
 $classDir
 
 $isTypePrimitive
 
 $visible
 
- Data Fields inherited from PntDescriptor
 $name
 
 $label
 

Constructor & Destructor Documentation

__construct (   $name,
  $type,
  $readOnly,
  $minValue,
  $maxValue,
  $minLength,
  $maxLength,
  $classDir 
)
Parameters
string$aStringmust be alpanumeric

Member Function Documentation

__toString ( )
_deriveValueFor (   $obj)
_getOptionsFor (   $obj)
_getValueFor (   $obj)
_getValueValidator ( )
_propagateValue_for (   $value,
  $obj 
)
_setValue_for (   $value,
  $obj 
)
deriveValueFor (   $obj)

Return the property value for the object Called if no getter method exists. Should be implemented by subClass.

Parameters
$objPntObject The object whose property value to answer
Exceptions
PmtError
getClassDir ( )

Returns the directory of the class file of the type of the property As the type class can not be loaded without knowing its classDir, the classDir must be specified ont the property if it is not default. Default is the classDir of the owner.

Returns
String
getCompulsory ( )
Returns
boolean Wheather null values, empty Strings or objects with empty labels are forbidden
getDbSortPaths ( )

Get the paths that can be used to make the database sort by this property

Returns
Array of string Navigational paths, not null
getHoldsId ( )
Returns
boolean wheather this holds an id. Id's are generally not visible and numerical ids do not have thousends separators
getIdPropertyDescriptor ( )
getMaxLength ( )
getMaxValue ( )
getMinLength ( )
getMinValue ( )
getName ( )
getOptionsFilter (   $obj,
  $filter 
)
getOptionsFor (   $obj,
  $filter = true 
)

Return the property options for the object If an options method exists, answer the method result. otherwise delegate to the types ClassDescriptor If the type is a class name and the class has a method 'getInstances' assume it is a static method, call it and return the result.

Exceptions
PntReflectionErrorif ClassDescriptor returns null, or type is not a class
Parameters
PntObjectthe object to get the options for
PntSqlFilter$filterignoored
Returns
Array the options
getOwner ( )
getPersistent ( )

Defines the persistency of the property.

Returns
mixed PNT_NOT (=false), PNT_READ_WRITE (=true), PNT_READ_ONLY
getReadOnly ( )

answer wheather the property value may be modified explicitely if false, calling a setter or changing a field value or other explicit property change action will be undefined

getType ( )
getValueFor (   $obj,
  $filter = true 
)

Answer the property value for the object If a getter method exists, call it (passing the filter) and return the method result. else derive value through default metabehavior

Parameters
PntSqlFilter$filterto apply, or null if unfiltered (currently only used by multi value properties)
Returns
mixed dynmically typed by the PropertyDescriptor>>type
Exceptions
PntErrorif property missing, derivation fails, or anything an evetial getter method throws
getValueValidator ( )

Returns the ValueValidator used for validating property values !Do not call this method directly, use getValueValidator($propertyName) on the object whose property values have to be validated, or better, let the object do the validation using validateGetErrorString($propertyName, $value)

Returns
ValueValidator
getVisible ( )
hasOptionsGetter (   $obj)
isDerived ( )
isFieldProperty ( )
isLegalType (   $aString)
isMultiValue ( )
isTypePrimitive ( )
isValue_in (   $value,
  $someObjects 
)
isValueInOptionsOf (   $obj,
  $filter = false 
)
Exceptions
PntError
static primitiveTypes ( )
static
propagateValue_for (   $value,
  $obj 
)

Set the property value for the object Called if no setter method exists and the property is not readOnly. Should be implemented by subClass.

Parameters
@valuevarianr The value to set
@objPntObject The object whose property value to set
Exceptions
PntError
setClassDir (   $value)

See Getter

setDbSortPaths (   $paths)

Set the paths that can be used to make the database sort by this property

Parameters
Arrayof string $paths Navigational paths, not null
setMaxLength (   $aValue)
setMaxValue (   $aValue)
setMinLength (   $aValue)
setMinValue (   $aValue)
setName (   $aString)
Parameters
string$aStringmust be alpanumeric
setOwner (   $anPntClassDescriptor)
setReadOnly (   $aValue)
setType (   $aString)
setValue_for (   $value,
  $obj 
)

Set the property value for the object If a setter method exists, use the method and answer result. else set field value

setVisible (   $value)

Field Documentation

$classDir
$maxLength
$maxValue
$minLength = 0
$minValue
$name
$ownerName
$readOnly
$type
$visible

The documentation for this class was generated from the following file: