VCL
[ class tree: VCL ] [ index: VCL ] [ all elements ]

Class: Object

Source Location: /system.inc.php

Class Overview


Object is the ultimate ancestor of all objects and components.


Variables

Methods


Child classes:

Filer
A base class that reads/writes components from/to an xml stream
Collection
A class for storing and managing a list of objects. This class acts as a wrapper over a PHP array.
Persistent
A base class for persistent objects which are the ones which provide the required features to be serialized/unserialized easily.
Field
Encapsulates a table field
PropertyEditor
Base class for property editors
ComponentEditor
Base class for component editors

Class Details

[line 77]
Object is the ultimate ancestor of all objects and components.

Object encapsulates fundamental behavior common to objects by introducing methods that

create, maintain and destroy instances of the object by allocating, initializing, and freeing required memory.

respond when object instances are created or destroyed.

return class-type and instance information on an object and runtime type information (RTTI) about its published properties.

Use Object as an immediate base class when declaring simple objects that do not need to persist (are not saved and reloaded in the session) and that do not need to be assigned to other objects.

Much of the capability of objects is established by methods that Object introduces. Many of these methods are used internally by IDEs and are not intended for users to call directly. Others are overridden in descendant objects that have more complex behavior.

Although Object is the based object of a component framework, not all objects are components. All component classes are descended from Component.

To create a class that belongs to the class library, you must, at least, inherit from Object, which provides the basic methods to work.




[ Top ]


Class Variables

$input = null

[line 82]

Global input object, easily accessible without declaring global



Tags:

access:  public

Type:   mixed


[ Top ]



Class Methods


constructor __construct [line 98]

Object __construct( )

Constructs an object and initializes its data before the object is first used.

Create constructs an object. The purpose, size, and behavior of objects differ greatly. The Create constructor defined by Object allocates memory but does not initialize data.

Descendant objects usually define a constructor that creates the particular kind of object and initializes its data.

In Object, this constructor basically assigns the globa Input object to be available as a field for all objects.




Overridden in child classes as:

Filer::__construct()
Initializes the object by setting up a list of parents and the xml parser used to read/write components
Collection::__construct()
Component::__construct()
Component constructor
ActionList::__construct()
User::__construct()
BusinessObject::__construct()
Control::__construct()
Constructor for the class
FocusControl::__construct()
CustomCheckListBox::__construct()
MonthCalendar::__construct()
DateTimePicker::__construct()
DBPaginator::__construct()
CustomPanel::__construct()
Panel::__construct()
Clock::__construct()
DBRepeater::__construct()
CustomDBGrid::__construct()
CustomListBox::__construct()
ComboBox::__construct()
Image::__construct()
CustomRadioGroup::__construct()
CustomPage::__construct()
Page::__construct()
Frameset::__construct()
Frame::__construct()
DWidget::__construct()
CustomProgressBar::__construct()
QWidget::__construct()
BitBtn::__construct()
SpeedButton::__construct()
CustomListView::__construct()
DBGrid::__construct()
CustomPageControl::__construct()
CustomTreeView::__construct()
CustomTextField::__construct()
CustomLabeledEdit::__construct()
CustomUpDown::__construct()
ColorSelector::__construct()
CustomToolBar::__construct()
GroupBox::__construct()
CustomButtonView::__construct()
Window::__construct()
CustomMainMenu::__construct()
ScrollBar::__construct()
CustomEdit::__construct()
CustomMemo::__construct()
CustomRichEdit::__construct()
ButtonControl::__construct()
Button::__construct()
CustomCheckBox::__construct()
RadioButton::__construct()
CustomUpload::__construct()
SimpleChart::__construct()
FlashObject::__construct()
Bevel::__construct()
CustomLabel::__construct()
DBIteratorBegin::__construct()
DBIteratorEnd::__construct()
MapShape::__construct()
Shape::__construct()
PaintBox::__construct()
HiddenField::__construct()
Pager::__construct()
CustomConnection::__construct()
Database::__construct()
IBDatabase::__construct()
MySQLDatabase::__construct()
OracleDatabase::__construct()
DataSet::__construct()
Datasource::__construct()
Application::__construct()
ImageList::__construct()
PageTemplate::__construct()
TemplateManager::__construct()
Service::__construct()
TreeNode::__construct()
Canvas::__construct()

[ Top ]

method className [line 130]

string className( )

Returns a string indicating the type of the object instance (as opposed to the type of the variable passed as an argument).

Use ClassName to obtain the class name from an object instance. This is useful for differentiating object instances that are assigned to a variable that has the type of an ancestor class.

  1.  <?php
  2.          //Class definition
  3.          class Unit467 extends Page
  4.          {
  5.                 function Unit467BeforeShow($sender$params)
  6.                 {
  7.                  echo $this->className();
  8.                  //This will echo Unit467 on the browser
  9.                 }
  10.  
  11.          }
  12.  ?>




Tags:

return:  Name of this object class


[ Top ]

method classNameIs [line 158]

boolean classNameIs( string $name)

Determines whether an object is of a specific type.

ClassNameIs determines whether an object instance has a class name that matches a specified string.

  1.  <?php
  2.          //Class definition
  3.          class Unit467 extends Page
  4.          {
  5.                 function Unit467BeforeShow($sender$params)
  6.                 {
  7.                   if ($this->classNameIs("Unit467")) echo "This is the right form!";
  8.                 }
  9.  
  10.          }
  11.  ?>




Tags:

return:  True if classname of this object is $name


Parameters:

string   $name   Name to compare

[ Top ]

method classParent [line 213]

class classParent( )

Returns the type of the immediate ancestor of a class.

ClassParent returns the name of the parent class for an object instance. For Object, ClassParent returns false. Avoid using ClassParent in application code.

  1.  <?php
  2.          //Class definition
  3.          class Unit467 extends Page
  4.          {
  5.                 function Unit467BeforeShow($sender$params)
  6.                 {
  7.                    echo $this->classParent();
  8.                    //This will echo Page
  9.                 }
  10.  
  11.          }
  12.  ?>




Tags:

return:  Class from which this object inherits


[ Top ]

method inheritsFrom [line 243]

boolean inheritsFrom( string $class)

Determines the relationship of two object types.

Use InheritsFrom to determine if a particular class type or object is an instance of a class or one of its descendants. InheritsFrom returns true if the object type specified in the class parameter is an ancestor of the object type or the type of the object itself. Otherwise, it returns false.

  1.  <?php
  2.          //Class definition
  3.          class Unit467 extends Page
  4.          {
  5.                 function Unit467BeforeShow($sender$params)
  6.                 {
  7.                    if ($this->inheritsFrom("Page")) echo "This is a page!";
  8.                 }
  9.  
  10.          }
  11.  ?>




Tags:

return:  True if this object inherits from $class


Parameters:

string   $class   Class name to check

[ Top ]

method methodExists [line 184]

boolean methodExists( string $method)

Check if a method exists declared on this object instance.

  1.  <?php
  2.          //Class definition
  3.          class Unit467 extends Page
  4.          {
  5.                 function Unit467BeforeShow($sender$params)
  6.                 {
  7.                   if ($this->methodExists("Unit467BeforeShow")) echo "It exists!";
  8.                 }
  9.  
  10.          }
  11.  ?>




Tags:

return:  True if $method exists


Parameters:

string   $method   Method name to check

[ Top ]

method readProperty [line 254]

void readProperty( string $propertyname, string $valuename, [string $stream = 'post'])

Reads a property from the streams



Parameters:

string   $propertyname   Name of the property to read
string   $valuename   Value name to read
string   $stream   Stream to read from

[ Top ]

method __get [line 276]

mixed __get( string $nm)

To virtualize properties

This PHP magic method is used on the class library to allow you create property (public and published) so you can write setters and getters and use property names in your code.




Overridden in child classes as:

DBDataSet::__get()
Overriden to allow get field values as properties
IBDataSet::__get()
Overriden to allow get field values as properties
MySQLDataSet::__get()
Overriden to allow get field values as properties
OracleDataSet::__get()
Overriden to allow get field values as properties

Parameters:

string   $nm   Property name

[ Top ]

method __set [line 324]

void __set( string $nm, mixed $val)

To virtualize properties

This PHP magic method is used on the class library to allow you create property (public and published) so you can write setters and getters and use property names in your code.




Overridden in child classes as:

DBDataSet::__set()
Overriden to allow get field values as properties
IBDataSet::__set()
Overriden to allow get field values as properties
MySQLDataSet::__set()
Overriden to allow get field values as properties
OracleDataSet::__set()
Overriden to allow get field values as properties

Parameters:

string   $nm   Property name
mixed   $val   Property value

[ Top ]


Documentation generated on Sat, 13 Jun 2009 10:52:12 -0700 by phpDocumentor 1.4.1