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

Inherited by PntDbObject, PntIdentifiedOption, PntObjectTemplate, PntSqlSpec, PntStringConverter, and PntXmlPart.

Public Member Functions

 __construct ()
 
 copy ()
 
 getClass ()
 
 getClassDescriptor ()
 
 initPropertyDescriptors ()
 
 getOid ()
 
 addFieldProp ($name, $type, $readOnly=false, $minValue=null, $maxValue=null, $minLength=0, $maxLength=null, $classDir=null, $persistent=true)
 
 addDerivedProp ($name, $type, $readOnly=true, $minValue=null, $maxValue=null, $minLength=0, $maxLength=null, $classDir=null)
 
 addMultiValueProp ($name, $type, $readOnly=true, $minValue=null, $maxValue=null, $minLength=0, $maxLength=null, $classDir=null)
 
 getPropertyDescriptor ($propertyName)
 
 get ($propertyName, $filter=true)
 
 set ($propertyName, $value)
 
 getOptions ($name, $filter=true)
 
 getValueValidator ($prop)
 
 validateGetErrorString ($prop, $value, $validateReadOnly=true)
 
 basicGetLabel ()
 
 getLabel ()
 
 __toString ()
 
 release ()
 
 getEditInfo ()
 
 toString ()
 
 _getValueValidator ($prop)
 

Static Public Member Functions

static isPersistent ()
 
static getClassDescriptorClass ()
 
static getClassDir ()
 
static getClassLabel ()
 
static getUiColumnPaths ()
 
static getReportColumnPaths ()
 
static getUiFieldPaths ($clsDes)
 
static newNavigation ($key, $itemType)
 

Constructor & Destructor Documentation

__construct ( )

Constuctors can not decide what class to instatiate. If subclass has to instanciated depending on a parameter, implement it in a subclass of PntClassDescriptor Therefore this constructor should not be called from framework

Member Function Documentation

__toString ( )

String representation for debugging purposes

_getValueValidator (   $prop)
addDerivedProp (   $name,
  $type,
  $readOnly = true,
  $minValue = null,
  $maxValue = null,
  $minLength = 0,
  $maxLength = null,
  $classDir = null 
)
Parameters
string$aStringmust be alpanumeric
addFieldProp (   $name,
  $type,
  $readOnly = false,
  $minValue = null,
  $maxValue = null,
  $minLength = 0,
  $maxLength = null,
  $classDir = null,
  $persistent = true 
)
Parameters
string$aStringmust be alpanumeric
addMultiValueProp (   $name,
  $type,
  $readOnly = true,
  $minValue = null,
  $maxValue = null,
  $minLength = 0,
  $maxLength = null,
  $classDir = null 
)
Parameters
string$aStringmust be alpanumeric
basicGetLabel ( )
copy ( )

, use clone $this, implement __clone()

get (   $propertyName,
  $filter = true 
)

get the value of the property with the specified name

Parameters
string$propertyNamethe name by which a PntPropertyDescriptor can be obtained from ::getPropertyDescriptor
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
getClass ( )
getClassDescriptor ( )
static getClassDescriptorClass ( )
static
static getClassDir ( )
static

Returns the directory of the class file

Returns
String
static getClassLabel ( )
static

Returns the label of the class, or null if none. To get a defaulted label use the PntClassDescriptor method

Returns
String
getEditInfo ( )

Information for the user that is editing the object Should be overridden

Returns
String Html
getLabel ( )

String representation for representation in UI Default implementation: value of defaultLabelProp, if none basicGetLabel

getOid ( )
Returns
a string that identifies the object (case insensitive) the class name is in original case so it should be possible to include the class file using the class name from the oid.
getOptions (   $name,
  $filter = true 
)

Return the property options for this If an options method exists, answer the method result. otherwise delegate to the types ClassDescriptor

Parameters
string$nameproperty name
PntSqlFilter$filteror boolean wheather to use the global filter
Returns
array with elements dynamically typed by the PropertyDescriptor
Exceptions
PntReflectionErrorif ClassDescriptor returns null, or type is not a class
getPropertyDescriptor (   $propertyName)
static getReportColumnPaths ( )
static

Returns the paths for columns to be used in reports Default is null, the reporpage will use getUiColumnPaths override if required.

Returns
Array of String or String For keys that are Strings, the keys will be used as column label
static getUiColumnPaths ( )
static
static getUiFieldPaths (   $clsDes)
static
getValueValidator (   $prop)

Returns the ValueValidator used for validating property values !Do not call this method directly, use validateGetErrorString($propertyDescriptor, $value)

Parameters
propPntPropertyDescriptor
Returns
ValueValidator
initPropertyDescriptors ( )
static isPersistent ( )
static
static newNavigation (   $key,
  $itemType 
)
static
release ( )

Release values that are cached on $this. Default is to release cached values of all multi value properties. This method should be overridden if the there are other values cached on $this. (Derived properties default behavior is not to cache their values on the peanuts, their values are already cached on the ClassDescriptor,

See Also
PntDbClassDescriptor::getDescribedClassInstanceForData
set (   $propertyName,
  $value 
)
toString ( )
validateGetErrorString (   $prop,
  $value,
  $validateReadOnly = true 
)

Validate the value for the property. Answer null if valid. Answer the error String if invalid. Override this method to modify the validation behavior. Default is just to use the validator from _getValueValidator. You may change ValueValidator to override the error messages or the generic behavior inherited from PntValueValidator

Parameters
propPntPropertyDescriptor
valuemixed value to be validated.
Returns
String the error string or null if the value is valid

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